chore(deps): update & add Makefile

This commit is contained in:
Sun-ZhenXing
2025-08-28 14:41:00 +08:00
parent 79c5e87526
commit 660f11cccb
6 changed files with 734 additions and 712 deletions

View File

@@ -19,3 +19,7 @@ trim_trailing_whitespace = false
[Dockerfile]
indent_size = 4
[Makefile]
indent_size = 4
indent_style = tab

19
Makefile Normal file
View File

@@ -0,0 +1,19 @@
.PHONY: i dev prod build update
i:
uv sync --all-extras --all-packages $(filter-out i,$(MAKECMDGOALS))
dev:
uv run --no-sync python -c "__import__('mcp_template_python.__main__').__main__.dev()" $(filter-out dev,$(MAKECMDGOALS))
prod:
uv run --no-sync python -c "__import__('mcp_template_python.__main__').__main__.main()" $(filter-out prod,$(MAKECMDGOALS))
build:
uv build $(filter-out build,$(MAKECMDGOALS))
update:
uv sync --all-extras --all-packages -U $(filter-out update,$(MAKECMDGOALS))
%:
@:

View File

@@ -14,13 +14,13 @@ This project provides an MCP application template integrated with FastAPI.
Install dependencies:
```bash
uv sync
make
```
Development:
```bash
uv run dev
make dev
```
You can access the example MCP interface (Streamable HTTP) via <http://127.0.0.1:3001/math/mcp>, or access the SSE interface via <http://127.0.0.1:3001/math/compatible/sse>.
@@ -28,7 +28,7 @@ You can access the example MCP interface (Streamable HTTP) via <http://127.0.0.1
Call via command line with `--stdio`:
```bash
uv run prod --stdio
make prod -- --stdio
```
## Deployment
@@ -36,13 +36,13 @@ uv run prod --stdio
Production:
```bash
uv run --no-sync prod
make prod
```
Build Python Wheel package:
```bash
uv build
make build
```
## Docker Deployment

View File

@@ -10,13 +10,12 @@ requires-python = ">=3.10"
dependencies = [
"fastapi[standard]>=0.115.0",
"mcp[cli]>=1.10.0",
"pydantic>=2.11.7",
"pydantic-settings>=2.5.0",
]
[project.scripts]
mcp-template-python = "mcp_template_python.__main__:main"
dev = "mcp_template_python.__main__:dev"
prod = "mcp_template_python.__main__:main"
[build-system]
requires = ["hatchling"]

View File

@@ -60,10 +60,8 @@ def main():
else:
import uvicorn
from .server import app
uvicorn.run(
app,
f"{__module_name__}.server:app",
host=args.host,
port=args.port,
)

1406
uv.lock generated

File diff suppressed because it is too large Load Diff