Skip to content

Commit 9965a6f

Browse files
committed
update project structure
1 parent 8113b4e commit 9965a6f

File tree

10 files changed

+753
-15
lines changed

10 files changed

+753
-15
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build twine
23+
24+
- name: Build and check package
25+
run: |
26+
python -m build
27+
twine check dist/*
28+
29+
- name: Publish to PyPI
30+
if: startsWith(github.ref, 'refs/tags')
31+
uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.10', '3.11', '3.12']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install -e ".[dev]"
28+
29+
- name: Lint with flake8
30+
run: |
31+
flake8 camel_toolkits_mcp --count --select=E9,F63,F7,F82 --show-source --statistics
32+
33+
- name: Format check with black
34+
run: |
35+
black --check camel_toolkits_mcp
36+
37+
- name: Test with pytest
38+
run: |
39+
pytest tests/ --cov=camel_toolkits_mcp

README.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,33 @@ Key features:
1414

1515
## Installation
1616

17+
You can install the package directly from PyPI:
18+
1719
```bash
18-
# Clone the repository
19-
git clone https://github.com/yourusername/camel-toolkits-mcp.git
20-
cd camel-toolkits-mcp
20+
pip install camel-toolkits-mcp
21+
```
2122

22-
# Install dependencies
23-
pip install -r requirements.txt
23+
Or install from source:
24+
25+
```bash
26+
git clone https://github.com/jinx0a/camel-toolkits-mcp.git
27+
cd camel-toolkits-mcp
28+
pip install -e .
2429
```
2530

2631
## Usage
2732

28-
### Starting the Server
33+
Start the server:
2934

3035
```bash
31-
python server.py
36+
python -m camel_toolkits_mcp
3237
```
3338

34-
This will start the MCP server, which exposes two main tools:
39+
This will start an MCP server that exposes the following tools:
3540

36-
1. `get_toolkits()` - Lists all available toolkits in the Camel framework
37-
2. `register_toolkit(toolkit_name, api_keys)` - Loads a specific toolkit and registers its tools
41+
- `get_toolkits_list()`: Lists all available Camel toolkits
42+
- `register_toolkit()`: Registers a toolkit by name
43+
- `get_toolkit_info()`: Gets information about a toolkit's parameters
3844

3945
### Example: Using Notion Toolkit
4046

@@ -86,9 +92,32 @@ For toolkits requiring API keys (like Notion, OpenAI, etc.), you can provide the
8692
1. Set in environment variables before starting the server
8793
2. Provide them directly when calling `register_toolkit`
8894

95+
## Development
96+
97+
To set up a development environment:
98+
99+
```bash
100+
pip install -e ".[dev]"
101+
```
102+
103+
Run tests:
104+
105+
```bash
106+
pytest
107+
```
108+
89109
## Contributing
90110

91-
Contributions are welcome! Please feel free to submit a Pull Request.
111+
Contributions are welcome! The project uses GitHub Actions for CI/CD:
112+
113+
1. Tests are run automatically on pull requests
114+
2. New releases are automatically published to PyPI when a GitHub release is created
115+
116+
To publish a new version:
117+
118+
1. Update the version in `camel_toolkits_mcp/__init__.py`
119+
2. Create a new GitHub release with a tag like `v0.1.0`
120+
3. The GitHub workflow will automatically build and publish to PyPI
92121

93122
## License
94123

camel_toolkits_mcp/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""
2+
Camel Toolkits MCP - A server that exports Camel toolkits as MCP-compatible tools.
3+
"""
4+
5+
__version__ = "0.1.0"

camel_toolkits_mcp/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""
2+
Main entry point for the camel-toolkits-mcp package.
3+
"""
4+
5+
import sys
6+
from camel_toolkits_mcp.server import main
7+
8+
if __name__ == "__main__":
9+
sys.exit(main())

0 commit comments

Comments
 (0)