Skip to content

Commit 691ca3a

Browse files
authored
Merge pull request #1 from tadata-org/improvements
Refactor
2 parents 9afba6b + 706c8c8 commit 691ca3a

28 files changed

+2762
-2195
lines changed

.gitignore

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
poetry.lock
102+
103+
# pdm
104+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
105+
.pdm.toml
106+
.pdm-python
107+
.pdm-build/
108+
109+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
110+
__pypackages__/
111+
112+
# Celery stuff
113+
celerybeat-schedule
114+
celerybeat.pid
115+
116+
# SageMath parsed files
117+
*.sage.py
118+
119+
# Environments
120+
.env
121+
.venv
122+
env/
123+
venv/
124+
ENV/
125+
env.bak/
126+
venv.bak/
127+
128+
# Spyder project settings
129+
.spyderproject
130+
.spyproject
131+
132+
# Rope project settings
133+
.ropeproject
134+
135+
# mkdocs documentation
136+
/site
137+
138+
# mypy
139+
.mypy_cache/
140+
.dmypy.json
141+
dmypy.json
142+
143+
# Pyre type checker
144+
.pyre/
145+
146+
# pytype static type analyzer
147+
.pytype/
148+
149+
# Cython debug symbols
150+
cython_debug/
151+
152+
# PyCharm
153+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
154+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
155+
# and can be added to the global gitignore or merged into this file.
156+
.idea/
157+
*.iml
158+
*.iws
159+
*.ipr
160+
*.iws
161+
.idea_modules/
162+
163+
# VSCode
164+
.vscode/
165+
166+
# Ruff linter
167+
.ruff_cache/
168+
169+
# Mac/OSX
170+
.DS_Store
171+
172+
# Windows
173+
Thumbs.db
174+
ehthumbs.db
175+
Desktop.ini
176+
177+
# Repomix output
178+
repomix-output.txt

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.1.2]
9+
10+
### Changed
11+
- Complete refactor: transformed from a code generator to a direct integration library
12+
- Replaced the CLI-based approach with a direct API for adding MCP servers to FastAPI applications
13+
- Integrated MCP servers now mount directly to FastAPI apps at runtime instead of generating separate code
14+
- Simplified the API with a single `add_mcp_server` function for quick integration
15+
- Removed code generation entirely in favor of runtime integration
16+
17+
### Added
18+
- Main `add_mcp_server` function for simple MCP server integration
19+
- Support for adding custom MCP tools alongside API-derived tools
20+
- Improved test suite
21+
- Manage with uv
22+
23+
### Removed
24+
- CLI interface and all associated commands (generate, run, install, etc.)
25+
- Code generation functionality
26+
827
## [0.1.1] - 2024-07-03
928

1029
### Fixed

CONTRIBUTING.md

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,58 @@
22

33
First off, thank you for considering contributing to FastAPI-MCP!
44

5-
## Development Process
5+
## Development Setup
66

7-
1. Fork the repository
8-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
9-
3. Make your changes
10-
4. Run the tests (`pytest`)
11-
5. Format your code (`black .` and `isort .`)
12-
6. Commit your changes (`git commit -m 'Add some amazing feature'`)
13-
7. Push to the branch (`git push origin feature/amazing-feature`)
14-
8. Open a Pull Request
15-
16-
## Setting Up Development Environment
7+
1. Make sure you have Python 3.10+ installed
8+
2. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) (recommended) or pip
9+
3. Fork the repository
10+
4. Clone your fork and set up the development environment:
1711

1812
```bash
1913
# Clone your fork
20-
git clone https://github.com/tadata-org/fastapi_mcp
14+
git clone https://github.com/YOUR-USERNAME/fastapi_mcp.git
2115
cd fastapi-mcp
2216

23-
# Create a virtual environment
24-
python -m venv venv
25-
source venv/bin/activate # On Windows: venv\Scripts\activate
17+
# Create a virtual environment with uv (recommended)
18+
uv venv
19+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
20+
21+
# Install development dependencies with uv
22+
uv add -e ".[dev]"
2623

27-
# Install development dependencies
28-
pip install -e ".[dev]"
24+
# Alternatively, using pip
25+
# python -m venv venv
26+
# source venv/bin/activate # On Windows: venv\Scripts\activate
27+
# pip install -e ".[dev]"
2928
```
3029

30+
## Development Process
31+
32+
1. Fork the repository
33+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
34+
3. Make your changes
35+
4. Run type checking (`uv run mypy .`)
36+
5. Run the tests (`uv run pytest`)
37+
6. Format your code (`uv run ruff check .` and `uv run ruff format .`)
38+
7. Commit your changes (`git commit -m 'Add some amazing feature'`)
39+
8. Push to the branch (`git push origin feature/amazing-feature`)
40+
9. Open a Pull Request
41+
3142
## Code Style
3243

3344
We use the following tools to ensure code quality:
3445

35-
- **Black** for code formatting
36-
- **isort** for import sorting
3746
- **ruff** for linting
3847
- **mypy** for type checking
3948

4049
Please make sure your code passes all checks before submitting a pull request:
4150

4251
```bash
43-
black .
44-
isort .
52+
# Using uv
53+
uv run ruff check .
54+
uv run mypy .
55+
56+
# Or directly if tools are installed
4557
ruff check .
4658
mypy .
4759
```
@@ -51,6 +63,10 @@ mypy .
5163
We use pytest for testing. Please write tests for any new features and ensure all tests pass:
5264

5365
```bash
66+
# Using uv
67+
uv run pytest
68+
69+
# Or directly
5470
pytest
5571
```
5672

INSTALL.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)