Example MCP Server
# Example MCP Server using FastMCP
## Prerequisites
- uv
- python 3.12
## Install
After checking out the repo, run `uv venv` and `uv sync`
## How to run
### on Mac (replace folder name with the root of the repo)
`uv run --python /Users/chenjian/Documents/ai_projects/my_mcp_server/.venv/bin/python fastmcp run /Users/chenjian/Documents/ai_projects/my_mcp_server/main.py`
or
`uv run -p /Users/chenjian/Documents/ai_projects/my_mcp_server/.venv/bin/python fastmcp run /Users/chenjian/Documents/ai_projects/my_mcp_server/main.py`
## Adding this MCP on IDEs
- With `Claude Desktop` and `cursor`
```json
{
"mcpServers": {
"my_mcp_server": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--python",
"/Users/chenjian/Documents/ai_projects/.venv/bin/python",
"fastmcp",
"run",
"/Users/chenjian/Documents/ai_projects/my_mcp_server/main.py"
]
}
}
}
```
- With `Claude Code`
```sh
claude mcp add uv run --python /Users/chenjian/Documents/ai_projects/my_mcp_server/.venv/bin/python fastmcp run /Users/chenjian/Documents/ai_projects/my_mcp_server/main.py
```
or
```sh
claude mcp add uv run -p /Users/chenjian/Documents/ai_projects/my_mcp_server/.venv/bin/python fastmcp run /Users/chenjian/Documents/ai_projects/my_mcp_server/main.py
```
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: add, subtract, multiply, and divide are basic arithmetic operations with no overlap, while magic_word is completely different, returning a random word. There is no ambiguity between tools.
Four tools (add, divide, multiply, subtract) follow a consistent verb pattern for arithmetic operations, but magic_word deviates with a noun-based name. The naming is mostly consistent with one minor deviation.
With 5 tools, this server is well-scoped for basic arithmetic and a simple word function. Each tool earns its place, and the count is appropriate for the apparent purpose.
For arithmetic, the surface is complete with add, subtract, multiply, and divide covering core operations. The magic_word tool adds a random function, but there is a minor gap in not including more advanced math operations like exponentiation or modulo.