python-server-template

mcp = FastMCP(name="my-server")

Content Preview
# Python MCP Server Template

```python
from fastmcp import FastMCP
import httpx
import os

mcp = FastMCP(name="my-server")
API_BASE = os.environ["API_BASE"]
API_TOKEN = os.environ["API_TOKEN"]

@mcp.tool()
def list_items(input: dict) -> dict:
    with httpx.Client(base_url=API_BASE, headers={"Authorization": f"Bearer {API_TOKEN}"}) as client:
        resp = client.get("/items", params=input)
        if resp.status_code >= 400:
            return {"error": {"code": "upstream_error", "message": "
How to Use

Recommended: Install to project (local)

mkdir -p .claude/skills
curl -o .claude/skills/python-server-template.md \
  https://raw.githubusercontent.com/alirezarezvani/claude-skills/main/engineering/mcp-server-builder/references/python-server-template.md

Skill is scoped to this project only. Add .claude/skills/ to your .gitignoreif you don't want to commit it.

Alternative: Clone full repo

git clone https://github.com/alirezarezvani/claude-skills

Then reference at engineering/mcp-server-builder/references/python-server-template.md

Related Skills