Skip to main content
Glama
Joseph19820124

Example MCP Server

README.md
# 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

B3.2/5.0

Scored across 5 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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.