|
| 1 | +# MCP Docs Server |
| 2 | + |
| 3 | +A simple way to make your documentation files available to AI assistants like Claude. |
| 4 | + |
| 5 | +## What Does This Do? |
| 6 | + |
| 7 | +Think of this as a **library catalog for your documentation**. You have a bunch of markdown files (`.md` files) with documentation, guides, or notes. This server: |
| 8 | + |
| 9 | +1. Finds all your markdown files automatically |
| 10 | +2. Makes them available to AI tools through something called MCP (Model Context Protocol) |
| 11 | +3. Lets AI assistants search through and read your documentation |
| 12 | + |
| 13 | +It's like giving Claude or other AI tools a filing cabinet of your documentation that they can open and read whenever they need information. |
| 14 | + |
| 15 | +## How It Works (Simple Explanation) |
| 16 | + |
| 17 | +1. **You put documentation files in folders** - Just save your `.md` files in organized folders |
| 18 | +2. **The server finds them automatically** - No need to manually register each file |
| 19 | +3. **AI can read them** - AI assistants can now access and search your documentation |
| 20 | + |
| 21 | +### Real Example |
| 22 | + |
| 23 | +Let's say you have documentation for "Service 1" with these files: |
| 24 | +- `user-functions.md` - How user features work |
| 25 | +- `call-functions.md` - How calling features work |
| 26 | +- `calendar-functions.md` - How calendar features work |
| 27 | + |
| 28 | +You would organize them like this: |
| 29 | + |
| 30 | +``` |
| 31 | +docs/ |
| 32 | +└── service-1/ |
| 33 | + ├── user-functions.md |
| 34 | + ├── call-functions.md |
| 35 | + └── calendar-functions.md |
| 36 | +``` |
| 37 | + |
| 38 | +That's it! The server will automatically find these files and make them available as: |
| 39 | +- `docs://service-1/user-functions` |
| 40 | +- `docs://service-1/call-functions` |
| 41 | +- `docs://service-1/calendar-functions` |
| 42 | + |
| 43 | +## Quick Start (Step by Step) |
| 44 | + |
| 45 | +### Step 1: Install Python Requirements |
| 46 | + |
| 47 | +You need Python 3.10 or newer and `uv` (a Python package manager) installed. |
| 48 | + |
| 49 | +Install `uv` if you don't have it: |
| 50 | +```bash |
| 51 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
| 52 | +``` |
| 53 | + |
| 54 | +Then install the required package: |
| 55 | + |
| 56 | +```bash |
| 57 | +uv pip install mcp |
| 58 | +``` |
| 59 | + |
| 60 | +### Step 2: Add Your Documentation Files |
| 61 | + |
| 62 | +Put your markdown files in the `docs/` folder. Organize them in subfolders by topic or service: |
| 63 | + |
| 64 | +``` |
| 65 | +docs/ |
| 66 | +├── service-1/ |
| 67 | +│ ├── user-functions.md |
| 68 | +│ ├── call-functions.md |
| 69 | +│ └── calendar-functions.md |
| 70 | +├── service-2/ |
| 71 | +│ └── api-guide.md |
| 72 | +└── getting-started/ |
| 73 | + └── introduction.md |
| 74 | +``` |
| 75 | + |
| 76 | +The subfolder name (like `service-1`) becomes the category. |
| 77 | + |
| 78 | +### Step 3: Connect to Claude Code |
| 79 | + |
| 80 | +The easiest way is to use the Claude Code CLI. From this project folder, run: |
| 81 | + |
| 82 | +```bash |
| 83 | +claude mcp add --transport stdio docs -- uv run python /full/path/to/mcp-example/src/mcp_docs_server.py |
| 84 | +``` |
| 85 | + |
| 86 | +Replace `/full/path/to/mcp-example` with your actual project path. |
| 87 | + |
| 88 | +Verify it's connected: |
| 89 | + |
| 90 | +```bash |
| 91 | +claude mcp list |
| 92 | +``` |
| 93 | + |
| 94 | +You should see: `docs: ... - ✓ Connected` |
| 95 | + |
| 96 | +That's it! Claude Code can now access your documentation. |
| 97 | + |
| 98 | +## Adding New Documentation |
| 99 | + |
| 100 | +To add new documentation at any time: |
| 101 | + |
| 102 | +1. Create a new `.md` file in the appropriate folder under `docs/` |
| 103 | +2. That's it! The server finds new files automatically |
| 104 | + |
| 105 | +For example, to add documentation for a new service: |
| 106 | + |
| 107 | +``` |
| 108 | +docs/ |
| 109 | +└── service-3/ # Create new folder |
| 110 | + └── setup.md # Add your documentation file |
| 111 | +``` |
| 112 | + |
| 113 | +No need to restart the server or change any code. |
| 114 | + |
| 115 | +## Using with Claude Code |
| 116 | + |
| 117 | +If you're using Claude Code (the CLI tool), follow Step 3 above. The server is already configured and running! |
| 118 | + |
| 119 | +You can now ask Claude Code questions like: |
| 120 | +- "List all available docs resources" |
| 121 | +- "Read the service-1/user-functions documentation" |
| 122 | +- "Search the docs for authentication" |
| 123 | + |
| 124 | +Claude Code will automatically access your documentation files. |
| 125 | + |
| 126 | +### Managing the Server |
| 127 | + |
| 128 | +Check if the server is connected: |
| 129 | +```bash |
| 130 | +claude mcp list |
| 131 | +``` |
| 132 | + |
| 133 | +Remove the server: |
| 134 | +```bash |
| 135 | +claude mcp remove docs |
| 136 | +``` |
| 137 | + |
| 138 | +Re-add the server if needed: |
| 139 | +```bash |
| 140 | +claude mcp add --transport stdio docs -- uv run python /full/path/to/mcp-example/src/mcp_docs_server.py |
| 141 | +``` |
| 142 | + |
| 143 | +## Connecting to Claude Desktop |
| 144 | + |
| 145 | +To make your documentation available in Claude Desktop: |
| 146 | + |
| 147 | +1. Find your Claude Desktop config file: |
| 148 | + - **Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json` |
| 149 | + - **Windows**: `%APPDATA%/Claude/claude_desktop_config.json` |
| 150 | + |
| 151 | +2. Open the file and add this (replace `/path/to/mcp-example` with your actual folder path): |
| 152 | + |
| 153 | +```json |
| 154 | +{ |
| 155 | + "mcpServers": { |
| 156 | + "docs": { |
| 157 | + "command": "python", |
| 158 | + "args": ["/path/to/mcp-example/src/mcp_docs_server.py"] |
| 159 | + } |
| 160 | + } |
| 161 | +} |
| 162 | +``` |
| 163 | + |
| 164 | +## Learn More |
| 165 | + |
| 166 | +- [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk) - Build your own MCP servers |
| 167 | +- [MCP Documentation](https://modelcontextprotocol.io) - Learn about Model Context Protocol |
| 168 | +- [MCP Python SDK Docs](https://modelcontextprotocol.github.io/python-sdk/) - Complete SDK reference |
0 commit comments