This is page 1 of 5. Use http://codebase.md/modelcontextprotocol/servers?lines=true&page={x} to view the full context. # Directory Structure ``` ├── .gitattributes ├── .github │ ├── pull_request_template.md │ └── workflows │ ├── claude.yml │ ├── python.yml │ ├── release.yml │ └── typescript.yml ├── .gitignore ├── .npmrc ├── .vscode │ └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── package-lock.json ├── package.json ├── README.md ├── scripts │ └── release.py ├── SECURITY.md ├── src │ ├── everything │ │ ├── CLAUDE.md │ │ ├── Dockerfile │ │ ├── everything.ts │ │ ├── index.ts │ │ ├── instructions.md │ │ ├── package.json │ │ ├── README.md │ │ ├── sse.ts │ │ ├── stdio.ts │ │ ├── streamableHttp.ts │ │ └── tsconfig.json │ ├── fetch │ │ ├── .python-version │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── pyproject.toml │ │ ├── README.md │ │ ├── src │ │ │ └── mcp_server_fetch │ │ │ ├── __init__.py │ │ │ ├── __main__.py │ │ │ └── server.py │ │ └── uv.lock │ ├── filesystem │ │ ├── __tests__ │ │ │ ├── directory-tree.test.ts │ │ │ ├── lib.test.ts │ │ │ ├── path-utils.test.ts │ │ │ ├── path-validation.test.ts │ │ │ └── roots-utils.test.ts │ │ ├── Dockerfile │ │ ├── index.ts │ │ ├── jest.config.cjs │ │ ├── lib.ts │ │ ├── package.json │ │ ├── path-utils.ts │ │ ├── path-validation.ts │ │ ├── README.md │ │ ├── roots-utils.ts │ │ └── tsconfig.json │ ├── git │ │ ├── .gitignore │ │ ├── .python-version │ │ ├── Dockerfile │ │ ├── LICENSE │ │ ├── pyproject.toml │ │ ├── README.md │ │ ├── src │ │ │ └── mcp_server_git │ │ │ ├── __init__.py │ │ │ ├── __main__.py │ │ │ ├── py.typed │ │ │ └── server.py │ │ ├── tests │ │ │ └── test_server.py │ │ └── uv.lock │ ├── memory │ │ ├── Dockerfile │ │ ├── index.ts │ │ ├── package.json │ │ ├── README.md │ │ └── tsconfig.json │ ├── sequentialthinking │ │ ├── Dockerfile │ │ ├── index.ts │ │ ├── package.json │ │ ├── README.md │ │ └── tsconfig.json │ └── time │ ├── .python-version │ ├── Dockerfile │ ├── pyproject.toml │ ├── README.md │ ├── src │ │ └── mcp_server_time │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── server.py │ ├── test │ │ └── time_server_test.py │ └── uv.lock └── tsconfig.json ``` # Files -------------------------------------------------------------------------------- /src/fetch/.python-version: -------------------------------------------------------------------------------- ``` 1 | 3.11 2 | ``` -------------------------------------------------------------------------------- /src/git/.python-version: -------------------------------------------------------------------------------- ``` 1 | 3.10 2 | ``` -------------------------------------------------------------------------------- /src/time/.python-version: -------------------------------------------------------------------------------- ``` 1 | 3.10 2 | ``` -------------------------------------------------------------------------------- /src/git/.gitignore: -------------------------------------------------------------------------------- ``` 1 | __pycache__ 2 | .venv 3 | ``` -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- ``` 1 | package-lock.json linguist-generated=true 2 | ``` -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- ``` 1 | registry="https://registry.npmjs.org/" 2 | @modelcontextprotocol:registry="https://registry.npmjs.org/" 3 | ``` -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- ``` 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | .pnpm-debug.log* 9 | 10 | # Diagnostic reports (https://nodejs.org/api/report.html) 11 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | *.lcov 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (https://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Snowpack dependency directory (https://snowpack.dev/) 46 | web_modules/ 47 | 48 | # TypeScript cache 49 | *.tsbuildinfo 50 | 51 | # Optional npm cache directory 52 | .npm 53 | 54 | # Optional eslint cache 55 | .eslintcache 56 | 57 | # Optional stylelint cache 58 | .stylelintcache 59 | 60 | # Microbundle cache 61 | .rpt2_cache/ 62 | .rts2_cache_cjs/ 63 | .rts2_cache_es/ 64 | .rts2_cache_umd/ 65 | 66 | # Optional REPL history 67 | .node_repl_history 68 | 69 | # Output of 'npm pack' 70 | *.tgz 71 | 72 | # Yarn Integrity file 73 | .yarn-integrity 74 | 75 | # dotenv environment variable files 76 | .env 77 | .env.development.local 78 | .env.test.local 79 | .env.production.local 80 | .env.local 81 | 82 | # parcel-bundler cache (https://parceljs.org/) 83 | .cache 84 | .parcel-cache 85 | 86 | # Next.js build output 87 | .next 88 | out 89 | 90 | # Nuxt.js build / generate output 91 | .nuxt 92 | dist 93 | 94 | # Gatsby files 95 | .cache/ 96 | # Comment in the public line in if your project uses Gatsby and not Next.js 97 | # https://nextjs.org/blog/next-9-1#public-directory-support 98 | # public 99 | 100 | # vuepress build output 101 | .vuepress/dist 102 | 103 | # vuepress v2.x temp and cache directory 104 | .temp 105 | .cache 106 | 107 | # Docusaurus cache and generated files 108 | .docusaurus 109 | 110 | # Serverless directories 111 | .serverless/ 112 | 113 | # FuseBox cache 114 | .fusebox/ 115 | 116 | # DynamoDB Local files 117 | .dynamodb/ 118 | 119 | # TernJS port file 120 | .tern-port 121 | 122 | # Stores VSCode versions used for testing VSCode extensions 123 | .vscode-test 124 | 125 | # Jetbrains IDEs 126 | .idea/ 127 | 128 | # yarn v2 129 | .yarn/cache 130 | .yarn/unplugged 131 | .yarn/build-state.yml 132 | .yarn/install-state.gz 133 | .pnp.* 134 | 135 | build/ 136 | 137 | gcp-oauth.keys.json 138 | .*-server-credentials.json 139 | 140 | # Byte-compiled / optimized / DLL files 141 | __pycache__/ 142 | *.py[cod] 143 | *$py.class 144 | 145 | # C extensions 146 | *.so 147 | 148 | # Distribution / packaging 149 | .Python 150 | build/ 151 | develop-eggs/ 152 | dist/ 153 | downloads/ 154 | eggs/ 155 | .eggs/ 156 | lib/ 157 | lib64/ 158 | parts/ 159 | sdist/ 160 | var/ 161 | wheels/ 162 | share/python-wheels/ 163 | *.egg-info/ 164 | .installed.cfg 165 | *.egg 166 | MANIFEST 167 | 168 | # PyInstaller 169 | # Usually these files are written by a python script from a template 170 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 171 | *.manifest 172 | *.spec 173 | 174 | # Installer logs 175 | pip-log.txt 176 | pip-delete-this-directory.txt 177 | 178 | # Unit test / coverage reports 179 | htmlcov/ 180 | .tox/ 181 | .nox/ 182 | .coverage 183 | .coverage.* 184 | .cache 185 | nosetests.xml 186 | coverage.xml 187 | *.cover 188 | *.py,cover 189 | .hypothesis/ 190 | .pytest_cache/ 191 | cover/ 192 | 193 | # Translations 194 | *.mo 195 | *.pot 196 | 197 | # Django stuff: 198 | *.log 199 | local_settings.py 200 | db.sqlite3 201 | db.sqlite3-journal 202 | 203 | # Flask stuff: 204 | instance/ 205 | .webassets-cache 206 | 207 | # Scrapy stuff: 208 | .scrapy 209 | 210 | # Sphinx documentation 211 | docs/_build/ 212 | 213 | # PyBuilder 214 | .pybuilder/ 215 | target/ 216 | 217 | # Jupyter Notebook 218 | .ipynb_checkpoints 219 | 220 | # IPython 221 | profile_default/ 222 | ipython_config.py 223 | 224 | # pyenv 225 | # For a library or package, you might want to ignore these files since the code is 226 | # intended to run in multiple environments; otherwise, check them in: 227 | # .python-version 228 | 229 | # pipenv 230 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 231 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 232 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 233 | # install all needed dependencies. 234 | #Pipfile.lock 235 | 236 | # poetry 237 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 238 | # This is especially recommended for binary packages to ensure reproducibility, and is more 239 | # commonly ignored for libraries. 240 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 241 | #poetry.lock 242 | 243 | # pdm 244 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 245 | #pdm.lock 246 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 247 | # in version control. 248 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 249 | .pdm.toml 250 | .pdm-python 251 | .pdm-build/ 252 | 253 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 254 | __pypackages__/ 255 | 256 | # Celery stuff 257 | celerybeat-schedule 258 | celerybeat.pid 259 | 260 | # SageMath parsed files 261 | *.sage.py 262 | 263 | # Environments 264 | .env 265 | .venv 266 | env/ 267 | venv/ 268 | ENV/ 269 | env.bak/ 270 | venv.bak/ 271 | 272 | # Spyder project settings 273 | .spyderproject 274 | .spyproject 275 | 276 | # Rope project settings 277 | .ropeproject 278 | 279 | # mkdocs documentation 280 | /site 281 | 282 | # mypy 283 | .mypy_cache/ 284 | .dmypy.json 285 | dmypy.json 286 | 287 | # Pyre type checker 288 | .pyre/ 289 | 290 | # pytype static type analyzer 291 | .pytype/ 292 | 293 | # Cython debug symbols 294 | cython_debug/ 295 | 296 | .DS_Store 297 | 298 | # PyCharm 299 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 300 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 301 | # and can be added to the global gitignore or merged into this file. For a more nuclear 302 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 303 | #.idea/ 304 | ``` -------------------------------------------------------------------------------- /src/sequentialthinking/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Sequential Thinking MCP Server 2 | 3 | An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process. 4 | 5 | ## Features 6 | 7 | - Break down complex problems into manageable steps 8 | - Revise and refine thoughts as understanding deepens 9 | - Branch into alternative paths of reasoning 10 | - Adjust the total number of thoughts dynamically 11 | - Generate and verify solution hypotheses 12 | 13 | ## Tool 14 | 15 | ### sequential_thinking 16 | 17 | Facilitates a detailed, step-by-step thinking process for problem-solving and analysis. 18 | 19 | **Inputs:** 20 | - `thought` (string): The current thinking step 21 | - `nextThoughtNeeded` (boolean): Whether another thought step is needed 22 | - `thoughtNumber` (integer): Current thought number 23 | - `totalThoughts` (integer): Estimated total thoughts needed 24 | - `isRevision` (boolean, optional): Whether this revises previous thinking 25 | - `revisesThought` (integer, optional): Which thought is being reconsidered 26 | - `branchFromThought` (integer, optional): Branching point thought number 27 | - `branchId` (string, optional): Branch identifier 28 | - `needsMoreThoughts` (boolean, optional): If more thoughts are needed 29 | 30 | ## Usage 31 | 32 | The Sequential Thinking tool is designed for: 33 | - Breaking down complex problems into steps 34 | - Planning and design with room for revision 35 | - Analysis that might need course correction 36 | - Problems where the full scope might not be clear initially 37 | - Tasks that need to maintain context over multiple steps 38 | - Situations where irrelevant information needs to be filtered out 39 | 40 | ## Configuration 41 | 42 | ### Usage with Claude Desktop 43 | 44 | Add this to your `claude_desktop_config.json`: 45 | 46 | #### npx 47 | 48 | ```json 49 | { 50 | "mcpServers": { 51 | "sequential-thinking": { 52 | "command": "npx", 53 | "args": [ 54 | "-y", 55 | "@modelcontextprotocol/server-sequential-thinking" 56 | ] 57 | } 58 | } 59 | } 60 | ``` 61 | 62 | #### docker 63 | 64 | ```json 65 | { 66 | "mcpServers": { 67 | "sequentialthinking": { 68 | "command": "docker", 69 | "args": [ 70 | "run", 71 | "--rm", 72 | "-i", 73 | "mcp/sequentialthinking" 74 | ] 75 | } 76 | } 77 | } 78 | ``` 79 | 80 | To disable logging of thought information set env var: `DISABLE_THOUGHT_LOGGING` to `true`. 81 | Comment 82 | 83 | ### Usage with VS Code 84 | 85 | For quick installation, click one of the installation buttons below... 86 | 87 | [](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-sequential-thinking%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-sequential-thinking%22%5D%7D&quality=insiders) 88 | 89 | [](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22mcp%2Fsequentialthinking%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22mcp%2Fsequentialthinking%22%5D%7D&quality=insiders) 90 | 91 | For manual installation, you can configure the MCP server using one of these methods: 92 | 93 | **Method 1: User Configuration (Recommended)** 94 | Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. 95 | 96 | **Method 2: Workspace Configuration** 97 | Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 98 | 99 | > For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp). 100 | 101 | For NPX installation: 102 | 103 | ```json 104 | { 105 | "servers": { 106 | "sequential-thinking": { 107 | "command": "npx", 108 | "args": [ 109 | "-y", 110 | "@modelcontextprotocol/server-sequential-thinking" 111 | ] 112 | } 113 | } 114 | } 115 | ``` 116 | 117 | For Docker installation: 118 | 119 | ```json 120 | { 121 | "servers": { 122 | "sequential-thinking": { 123 | "command": "docker", 124 | "args": [ 125 | "run", 126 | "--rm", 127 | "-i", 128 | "mcp/sequentialthinking" 129 | ] 130 | } 131 | } 132 | } 133 | ``` 134 | 135 | ## Building 136 | 137 | Docker: 138 | 139 | ```bash 140 | docker build -t mcp/sequentialthinking -f src/sequentialthinking/Dockerfile . 141 | ``` 142 | 143 | ## License 144 | 145 | This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 146 | ``` -------------------------------------------------------------------------------- /src/fetch/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Fetch MCP Server 2 | 3 | A Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption. 4 | 5 | > [!CAUTION] 6 | > This server can access local/internal IP addresses and may represent a security risk. Exercise caution when using this MCP server to ensure this does not expose any sensitive data. 7 | 8 | The fetch tool will truncate the response, but by using the `start_index` argument, you can specify where to start the content extraction. This lets models read a webpage in chunks, until they find the information they need. 9 | 10 | ### Available Tools 11 | 12 | - `fetch` - Fetches a URL from the internet and extracts its contents as markdown. 13 | - `url` (string, required): URL to fetch 14 | - `max_length` (integer, optional): Maximum number of characters to return (default: 5000) 15 | - `start_index` (integer, optional): Start content from this character index (default: 0) 16 | - `raw` (boolean, optional): Get raw content without markdown conversion (default: false) 17 | 18 | ### Prompts 19 | 20 | - **fetch** 21 | - Fetch a URL and extract its contents as markdown 22 | - Arguments: 23 | - `url` (string, required): URL to fetch 24 | 25 | ## Installation 26 | 27 | Optionally: Install node.js, this will cause the fetch server to use a different HTML simplifier that is more robust. 28 | 29 | ### Using uv (recommended) 30 | 31 | When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will 32 | use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-fetch*. 33 | 34 | ### Using PIP 35 | 36 | Alternatively you can install `mcp-server-fetch` via pip: 37 | 38 | ``` 39 | pip install mcp-server-fetch 40 | ``` 41 | 42 | After installation, you can run it as a script using: 43 | 44 | ``` 45 | python -m mcp_server_fetch 46 | ``` 47 | 48 | ## Configuration 49 | 50 | ### Configure for Claude.app 51 | 52 | Add to your Claude settings: 53 | 54 | <details> 55 | <summary>Using uvx</summary> 56 | 57 | ```json 58 | { 59 | "mcpServers": { 60 | "fetch": { 61 | "command": "uvx", 62 | "args": ["mcp-server-fetch"] 63 | } 64 | } 65 | } 66 | ``` 67 | </details> 68 | 69 | <details> 70 | <summary>Using docker</summary> 71 | 72 | ```json 73 | { 74 | "mcpServers": { 75 | "fetch": { 76 | "command": "docker", 77 | "args": ["run", "-i", "--rm", "mcp/fetch"] 78 | } 79 | } 80 | } 81 | ``` 82 | </details> 83 | 84 | <details> 85 | <summary>Using pip installation</summary> 86 | 87 | ```json 88 | { 89 | "mcpServers": { 90 | "fetch": { 91 | "command": "python", 92 | "args": ["-m", "mcp_server_fetch"] 93 | } 94 | } 95 | } 96 | ``` 97 | </details> 98 | 99 | ### Configure for VS Code 100 | 101 | For quick installation, use one of the one-click install buttons below... 102 | 103 | [](https://insiders.vscode.dev/redirect/mcp/install?name=fetch&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-fetch%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=fetch&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-fetch%22%5D%7D&quality=insiders) 104 | 105 | [](https://insiders.vscode.dev/redirect/mcp/install?name=fetch&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Ffetch%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=fetch&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Ffetch%22%5D%7D&quality=insiders) 106 | 107 | For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`. 108 | 109 | Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 110 | 111 | > Note that the `mcp` key is needed when using the `mcp.json` file. 112 | 113 | <details> 114 | <summary>Using uvx</summary> 115 | 116 | ```json 117 | { 118 | "mcp": { 119 | "servers": { 120 | "fetch": { 121 | "command": "uvx", 122 | "args": ["mcp-server-fetch"] 123 | } 124 | } 125 | } 126 | } 127 | ``` 128 | </details> 129 | 130 | <details> 131 | <summary>Using Docker</summary> 132 | 133 | ```json 134 | { 135 | "mcp": { 136 | "servers": { 137 | "fetch": { 138 | "command": "docker", 139 | "args": ["run", "-i", "--rm", "mcp/fetch"] 140 | } 141 | } 142 | } 143 | } 144 | ``` 145 | </details> 146 | 147 | ### Customization - robots.txt 148 | 149 | By default, the server will obey a websites robots.txt file if the request came from the model (via a tool), but not if 150 | the request was user initiated (via a prompt). This can be disabled by adding the argument `--ignore-robots-txt` to the 151 | `args` list in the configuration. 152 | 153 | ### Customization - User-agent 154 | 155 | By default, depending on if the request came from the model (via a tool), or was user initiated (via a prompt), the 156 | server will use either the user-agent 157 | ``` 158 | ModelContextProtocol/1.0 (Autonomous; +https://github.com/modelcontextprotocol/servers) 159 | ``` 160 | or 161 | ``` 162 | ModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotocol/servers) 163 | ``` 164 | 165 | This can be customized by adding the argument `--user-agent=YourUserAgent` to the `args` list in the configuration. 166 | 167 | ### Customization - Proxy 168 | 169 | The server can be configured to use a proxy by using the `--proxy-url` argument. 170 | 171 | ## Debugging 172 | 173 | You can use the MCP inspector to debug the server. For uvx installations: 174 | 175 | ``` 176 | npx @modelcontextprotocol/inspector uvx mcp-server-fetch 177 | ``` 178 | 179 | Or if you've installed the package in a specific directory or are developing on it: 180 | 181 | ``` 182 | cd path/to/servers/src/fetch 183 | npx @modelcontextprotocol/inspector uv run mcp-server-fetch 184 | ``` 185 | 186 | ## Contributing 187 | 188 | We encourage contributions to help expand and improve mcp-server-fetch. Whether you want to add new tools, enhance existing functionality, or improve documentation, your input is valuable. 189 | 190 | For examples of other MCP servers and implementation patterns, see: 191 | https://github.com/modelcontextprotocol/servers 192 | 193 | Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements to make mcp-server-fetch even more powerful and useful. 194 | 195 | ## License 196 | 197 | mcp-server-fetch is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 198 | ``` -------------------------------------------------------------------------------- /src/time/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Time MCP Server 2 | 3 | A Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection. 4 | 5 | ### Available Tools 6 | 7 | - `get_current_time` - Get current time in a specific timezone or system timezone. 8 | - Required arguments: 9 | - `timezone` (string): IANA timezone name (e.g., 'America/New_York', 'Europe/London') 10 | 11 | - `convert_time` - Convert time between timezones. 12 | - Required arguments: 13 | - `source_timezone` (string): Source IANA timezone name 14 | - `time` (string): Time in 24-hour format (HH:MM) 15 | - `target_timezone` (string): Target IANA timezone name 16 | 17 | ## Installation 18 | 19 | ### Using uv (recommended) 20 | 21 | When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will 22 | use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-time*. 23 | 24 | ### Using PIP 25 | 26 | Alternatively you can install `mcp-server-time` via pip: 27 | 28 | ```bash 29 | pip install mcp-server-time 30 | ``` 31 | 32 | After installation, you can run it as a script using: 33 | 34 | ```bash 35 | python -m mcp_server_time 36 | ``` 37 | 38 | ## Configuration 39 | 40 | ### Configure for Claude.app 41 | 42 | Add to your Claude settings: 43 | 44 | <details> 45 | <summary>Using uvx</summary> 46 | 47 | ```json 48 | { 49 | "mcpServers": { 50 | "time": { 51 | "command": "uvx", 52 | "args": ["mcp-server-time"] 53 | } 54 | } 55 | } 56 | ``` 57 | </details> 58 | 59 | <details> 60 | <summary>Using docker</summary> 61 | 62 | ```json 63 | { 64 | "mcpServers": { 65 | "time": { 66 | "command": "docker", 67 | "args": ["run", "-i", "--rm", "-e", "LOCAL_TIMEZONE", "mcp/time"] 68 | } 69 | } 70 | } 71 | ``` 72 | </details> 73 | 74 | <details> 75 | <summary>Using pip installation</summary> 76 | 77 | ```json 78 | { 79 | "mcpServers": { 80 | "time": { 81 | "command": "python", 82 | "args": ["-m", "mcp_server_time"] 83 | } 84 | } 85 | } 86 | ``` 87 | </details> 88 | 89 | ### Configure for Zed 90 | 91 | Add to your Zed settings.json: 92 | 93 | <details> 94 | <summary>Using uvx</summary> 95 | 96 | ```json 97 | "context_servers": [ 98 | "mcp-server-time": { 99 | "command": "uvx", 100 | "args": ["mcp-server-time"] 101 | } 102 | ], 103 | ``` 104 | </details> 105 | 106 | <details> 107 | <summary>Using pip installation</summary> 108 | 109 | ```json 110 | "context_servers": { 111 | "mcp-server-time": { 112 | "command": "python", 113 | "args": ["-m", "mcp_server_time"] 114 | } 115 | }, 116 | ``` 117 | </details> 118 | 119 | ### Configure for VS Code 120 | 121 | For quick installation, use one of the one-click install buttons below... 122 | 123 | [](https://insiders.vscode.dev/redirect/mcp/install?name=time&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-time%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=time&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-time%22%5D%7D&quality=insiders) 124 | 125 | [](https://insiders.vscode.dev/redirect/mcp/install?name=time&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Ftime%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=time&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Ftime%22%5D%7D&quality=insiders) 126 | 127 | For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`. 128 | 129 | Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 130 | 131 | > Note that the `mcp` key is needed when using the `mcp.json` file. 132 | 133 | <details> 134 | <summary>Using uvx</summary> 135 | 136 | ```json 137 | { 138 | "mcp": { 139 | "servers": { 140 | "time": { 141 | "command": "uvx", 142 | "args": ["mcp-server-time"] 143 | } 144 | } 145 | } 146 | } 147 | ``` 148 | </details> 149 | 150 | <details> 151 | <summary>Using Docker</summary> 152 | 153 | ```json 154 | { 155 | "mcp": { 156 | "servers": { 157 | "time": { 158 | "command": "docker", 159 | "args": ["run", "-i", "--rm", "mcp/time"] 160 | } 161 | } 162 | } 163 | } 164 | ``` 165 | </details> 166 | 167 | ### Configure for Zencoder 168 | 169 | 1. Go to the Zencoder menu (...) 170 | 2. From the dropdown menu, select `Agent Tools` 171 | 3. Click on the `Add Custom MCP` 172 | 4. Add the name and server configuration from below, and make sure to hit the `Install` button 173 | 174 | <details> 175 | <summary>Using uvx</summary> 176 | 177 | ```json 178 | { 179 | "command": "uvx", 180 | "args": ["mcp-server-time"] 181 | } 182 | ``` 183 | </details> 184 | 185 | ### Customization - System Timezone 186 | 187 | By default, the server automatically detects your system's timezone. You can override this by adding the argument `--local-timezone` to the `args` list in the configuration. 188 | 189 | Example: 190 | ```json 191 | { 192 | "command": "python", 193 | "args": ["-m", "mcp_server_time", "--local-timezone=America/New_York"] 194 | } 195 | ``` 196 | 197 | ## Example Interactions 198 | 199 | 1. Get current time: 200 | ```json 201 | { 202 | "name": "get_current_time", 203 | "arguments": { 204 | "timezone": "Europe/Warsaw" 205 | } 206 | } 207 | ``` 208 | Response: 209 | ```json 210 | { 211 | "timezone": "Europe/Warsaw", 212 | "datetime": "2024-01-01T13:00:00+01:00", 213 | "is_dst": false 214 | } 215 | ``` 216 | 217 | 2. Convert time between timezones: 218 | ```json 219 | { 220 | "name": "convert_time", 221 | "arguments": { 222 | "source_timezone": "America/New_York", 223 | "time": "16:30", 224 | "target_timezone": "Asia/Tokyo" 225 | } 226 | } 227 | ``` 228 | Response: 229 | ```json 230 | { 231 | "source": { 232 | "timezone": "America/New_York", 233 | "datetime": "2024-01-01T12:30:00-05:00", 234 | "is_dst": false 235 | }, 236 | "target": { 237 | "timezone": "Asia/Tokyo", 238 | "datetime": "2024-01-01T12:30:00+09:00", 239 | "is_dst": false 240 | }, 241 | "time_difference": "+13.0h", 242 | } 243 | ``` 244 | 245 | ## Debugging 246 | 247 | You can use the MCP inspector to debug the server. For uvx installations: 248 | 249 | ```bash 250 | npx @modelcontextprotocol/inspector uvx mcp-server-time 251 | ``` 252 | 253 | Or if you've installed the package in a specific directory or are developing on it: 254 | 255 | ```bash 256 | cd path/to/servers/src/time 257 | npx @modelcontextprotocol/inspector uv run mcp-server-time 258 | ``` 259 | 260 | ## Examples of Questions for Claude 261 | 262 | 1. "What time is it now?" (will use system timezone) 263 | 2. "What time is it in Tokyo?" 264 | 3. "When it's 4 PM in New York, what time is it in London?" 265 | 4. "Convert 9:30 AM Tokyo time to New York time" 266 | 267 | ## Build 268 | 269 | Docker build: 270 | 271 | ```bash 272 | cd src/time 273 | docker build -t mcp/time . 274 | ``` 275 | 276 | ## Contributing 277 | 278 | We encourage contributions to help expand and improve mcp-server-time. Whether you want to add new time-related tools, enhance existing functionality, or improve documentation, your input is valuable. 279 | 280 | For examples of other MCP servers and implementation patterns, see: 281 | https://github.com/modelcontextprotocol/servers 282 | 283 | Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements to make mcp-server-time even more powerful and useful. 284 | 285 | ## License 286 | 287 | mcp-server-time is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 288 | ``` -------------------------------------------------------------------------------- /src/memory/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Knowledge Graph Memory Server 2 | 3 | A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats. 4 | 5 | ## Core Concepts 6 | 7 | ### Entities 8 | Entities are the primary nodes in the knowledge graph. Each entity has: 9 | - A unique name (identifier) 10 | - An entity type (e.g., "person", "organization", "event") 11 | - A list of observations 12 | 13 | Example: 14 | ```json 15 | { 16 | "name": "John_Smith", 17 | "entityType": "person", 18 | "observations": ["Speaks fluent Spanish"] 19 | } 20 | ``` 21 | 22 | ### Relations 23 | Relations define directed connections between entities. They are always stored in active voice and describe how entities interact or relate to each other. 24 | 25 | Example: 26 | ```json 27 | { 28 | "from": "John_Smith", 29 | "to": "Anthropic", 30 | "relationType": "works_at" 31 | } 32 | ``` 33 | ### Observations 34 | Observations are discrete pieces of information about an entity. They are: 35 | 36 | - Stored as strings 37 | - Attached to specific entities 38 | - Can be added or removed independently 39 | - Should be atomic (one fact per observation) 40 | 41 | Example: 42 | ```json 43 | { 44 | "entityName": "John_Smith", 45 | "observations": [ 46 | "Speaks fluent Spanish", 47 | "Graduated in 2019", 48 | "Prefers morning meetings" 49 | ] 50 | } 51 | ``` 52 | 53 | ## API 54 | 55 | ### Tools 56 | - **create_entities** 57 | - Create multiple new entities in the knowledge graph 58 | - Input: `entities` (array of objects) 59 | - Each object contains: 60 | - `name` (string): Entity identifier 61 | - `entityType` (string): Type classification 62 | - `observations` (string[]): Associated observations 63 | - Ignores entities with existing names 64 | 65 | - **create_relations** 66 | - Create multiple new relations between entities 67 | - Input: `relations` (array of objects) 68 | - Each object contains: 69 | - `from` (string): Source entity name 70 | - `to` (string): Target entity name 71 | - `relationType` (string): Relationship type in active voice 72 | - Skips duplicate relations 73 | 74 | - **add_observations** 75 | - Add new observations to existing entities 76 | - Input: `observations` (array of objects) 77 | - Each object contains: 78 | - `entityName` (string): Target entity 79 | - `contents` (string[]): New observations to add 80 | - Returns added observations per entity 81 | - Fails if entity doesn't exist 82 | 83 | - **delete_entities** 84 | - Remove entities and their relations 85 | - Input: `entityNames` (string[]) 86 | - Cascading deletion of associated relations 87 | - Silent operation if entity doesn't exist 88 | 89 | - **delete_observations** 90 | - Remove specific observations from entities 91 | - Input: `deletions` (array of objects) 92 | - Each object contains: 93 | - `entityName` (string): Target entity 94 | - `observations` (string[]): Observations to remove 95 | - Silent operation if observation doesn't exist 96 | 97 | - **delete_relations** 98 | - Remove specific relations from the graph 99 | - Input: `relations` (array of objects) 100 | - Each object contains: 101 | - `from` (string): Source entity name 102 | - `to` (string): Target entity name 103 | - `relationType` (string): Relationship type 104 | - Silent operation if relation doesn't exist 105 | 106 | - **read_graph** 107 | - Read the entire knowledge graph 108 | - No input required 109 | - Returns complete graph structure with all entities and relations 110 | 111 | - **search_nodes** 112 | - Search for nodes based on query 113 | - Input: `query` (string) 114 | - Searches across: 115 | - Entity names 116 | - Entity types 117 | - Observation content 118 | - Returns matching entities and their relations 119 | 120 | - **open_nodes** 121 | - Retrieve specific nodes by name 122 | - Input: `names` (string[]) 123 | - Returns: 124 | - Requested entities 125 | - Relations between requested entities 126 | - Silently skips non-existent nodes 127 | 128 | # Usage with Claude Desktop 129 | 130 | ### Setup 131 | 132 | Add this to your claude_desktop_config.json: 133 | 134 | #### Docker 135 | 136 | ```json 137 | { 138 | "mcpServers": { 139 | "memory": { 140 | "command": "docker", 141 | "args": ["run", "-i", "-v", "claude-memory:/app/dist", "--rm", "mcp/memory"] 142 | } 143 | } 144 | } 145 | ``` 146 | 147 | #### NPX 148 | ```json 149 | { 150 | "mcpServers": { 151 | "memory": { 152 | "command": "npx", 153 | "args": [ 154 | "-y", 155 | "@modelcontextprotocol/server-memory" 156 | ] 157 | } 158 | } 159 | } 160 | ``` 161 | 162 | #### NPX with custom setting 163 | 164 | The server can be configured using the following environment variables: 165 | 166 | ```json 167 | { 168 | "mcpServers": { 169 | "memory": { 170 | "command": "npx", 171 | "args": [ 172 | "-y", 173 | "@modelcontextprotocol/server-memory" 174 | ], 175 | "env": { 176 | "MEMORY_FILE_PATH": "/path/to/custom/memory.json" 177 | } 178 | } 179 | } 180 | } 181 | ``` 182 | 183 | - `MEMORY_FILE_PATH`: Path to the memory storage JSON file (default: `memory.json` in the server directory) 184 | 185 | # VS Code Installation Instructions 186 | 187 | For quick installation, use one of the one-click installation buttons below: 188 | 189 | [](https://insiders.vscode.dev/redirect/mcp/install?name=memory&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-memory%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=memory&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-memory%22%5D%7D&quality=insiders) 190 | 191 | [](https://insiders.vscode.dev/redirect/mcp/install?name=memory&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22-v%22%2C%22claude-memory%3A%2Fapp%2Fdist%22%2C%22--rm%22%2C%22mcp%2Fmemory%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=memory&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22-v%22%2C%22claude-memory%3A%2Fapp%2Fdist%22%2C%22--rm%22%2C%22mcp%2Fmemory%22%5D%7D&quality=insiders) 192 | 193 | For manual installation, you can configure the MCP server using one of these methods: 194 | 195 | **Method 1: User Configuration (Recommended)** 196 | Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. 197 | 198 | **Method 2: Workspace Configuration** 199 | Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 200 | 201 | > For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp). 202 | 203 | #### NPX 204 | 205 | ```json 206 | { 207 | "servers": { 208 | "memory": { 209 | "command": "npx", 210 | "args": [ 211 | "-y", 212 | "@modelcontextprotocol/server-memory" 213 | ] 214 | } 215 | } 216 | } 217 | ``` 218 | 219 | #### Docker 220 | 221 | ```json 222 | { 223 | "servers": { 224 | "memory": { 225 | "command": "docker", 226 | "args": [ 227 | "run", 228 | "-i", 229 | "-v", 230 | "claude-memory:/app/dist", 231 | "--rm", 232 | "mcp/memory" 233 | ] 234 | } 235 | } 236 | } 237 | ``` 238 | 239 | ### System Prompt 240 | 241 | The prompt for utilizing memory depends on the use case. Changing the prompt will help the model determine the frequency and types of memories created. 242 | 243 | Here is an example prompt for chat personalization. You could use this prompt in the "Custom Instructions" field of a [Claude.ai Project](https://www.anthropic.com/news/projects). 244 | 245 | ``` 246 | Follow these steps for each interaction: 247 | 248 | 1. User Identification: 249 | - You should assume that you are interacting with default_user 250 | - If you have not identified default_user, proactively try to do so. 251 | 252 | 2. Memory Retrieval: 253 | - Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph 254 | - Always refer to your knowledge graph as your "memory" 255 | 256 | 3. Memory 257 | - While conversing with the user, be attentive to any new information that falls into these categories: 258 | a) Basic Identity (age, gender, location, job title, education level, etc.) 259 | b) Behaviors (interests, habits, etc.) 260 | c) Preferences (communication style, preferred language, etc.) 261 | d) Goals (goals, targets, aspirations, etc.) 262 | e) Relationships (personal and professional relationships up to 3 degrees of separation) 263 | 264 | 4. Memory Update: 265 | - If any new information was gathered during the interaction, update your memory as follows: 266 | a) Create entities for recurring organizations, people, and significant events 267 | b) Connect them to the current entities using relations 268 | c) Store facts about them as observations 269 | ``` 270 | 271 | ## Building 272 | 273 | Docker: 274 | 275 | ```sh 276 | docker build -t mcp/memory -f src/memory/Dockerfile . 277 | ``` 278 | 279 | For Awareness: a prior mcp/memory volume contains an index.js file that could be overwritten by the new container. If you are using a docker volume for storage, delete the old docker volume's `index.js` file before starting the new container. 280 | 281 | ## License 282 | 283 | This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 284 | ``` -------------------------------------------------------------------------------- /src/everything/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Everything MCP Server 2 | 3 | This MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities. 4 | 5 | ## Components 6 | 7 | ### Tools 8 | 9 | 1. `echo` 10 | - Simple tool to echo back input messages 11 | - Input: 12 | - `message` (string): Message to echo back 13 | - Returns: Text content with echoed message 14 | 15 | 2. `add` 16 | - Adds two numbers together 17 | - Inputs: 18 | - `a` (number): First number 19 | - `b` (number): Second number 20 | - Returns: Text result of the addition 21 | 22 | 3. `longRunningOperation` 23 | - Demonstrates progress notifications for long operations 24 | - Inputs: 25 | - `duration` (number, default: 10): Duration in seconds 26 | - `steps` (number, default: 5): Number of progress steps 27 | - Returns: Completion message with duration and steps 28 | - Sends progress notifications during execution 29 | 30 | 4. `printEnv` 31 | - Prints all environment variables 32 | - Useful for debugging MCP server configuration 33 | - No inputs required 34 | - Returns: JSON string of all environment variables 35 | 36 | 5. `sampleLLM` 37 | - Demonstrates LLM sampling capability using MCP sampling feature 38 | - Inputs: 39 | - `prompt` (string): The prompt to send to the LLM 40 | - `maxTokens` (number, default: 100): Maximum tokens to generate 41 | - Returns: Generated LLM response 42 | 43 | 6. `getTinyImage` 44 | - Returns a small test image 45 | - No inputs required 46 | - Returns: Base64 encoded PNG image data 47 | 48 | 7. `annotatedMessage` 49 | - Demonstrates how annotations can be used to provide metadata about content 50 | - Inputs: 51 | - `messageType` (enum: "error" | "success" | "debug"): Type of message to demonstrate different annotation patterns 52 | - `includeImage` (boolean, default: false): Whether to include an example image 53 | - Returns: Content with varying annotations: 54 | - Error messages: High priority (1.0), visible to both user and assistant 55 | - Success messages: Medium priority (0.7), user-focused 56 | - Debug messages: Low priority (0.3), assistant-focused 57 | - Optional image: Medium priority (0.5), user-focused 58 | - Example annotations: 59 | ```json 60 | { 61 | "priority": 1.0, 62 | "audience": ["user", "assistant"] 63 | } 64 | ``` 65 | 66 | 8. `getResourceReference` 67 | - Returns a resource reference that can be used by MCP clients 68 | - Inputs: 69 | - `resourceId` (number, 1-100): ID of the resource to reference 70 | - Returns: A resource reference with: 71 | - Text introduction 72 | - Embedded resource with `type: "resource"` 73 | - Text instruction for using the resource URI 74 | 75 | 9. `startElicitation` 76 | - Initiates an elicitation (interaction) within the MCP client. 77 | - Inputs: 78 | - `color` (string): Favorite color 79 | - `number` (number, 1-100): Favorite number 80 | - `pets` (enum): Favorite pet 81 | - Returns: Confirmation of the elicitation demo with selection summary. 82 | 83 | 10. `structuredContent` 84 | - Demonstrates a tool returning structured content using the example in the specification 85 | - Provides an output schema to allow testing of client SHOULD advisory to validate the result using the schema 86 | - Inputs: 87 | - `location` (string): A location or ZIP code, mock data is returned regardless of value 88 | - Returns: a response with 89 | - `structuredContent` field conformant to the output schema 90 | - A backward compatible Text Content field, a SHOULD advisory in the specification 91 | 92 | 11. `listRoots` 93 | - Lists the current MCP roots provided by the client 94 | - Demonstrates the roots protocol capability even though this server doesn't access files 95 | - No inputs required 96 | - Returns: List of current roots with their URIs and names, or a message if no roots are set 97 | - Shows how servers can interact with the MCP roots protocol 98 | 99 | ### Resources 100 | 101 | The server provides 100 test resources in two formats: 102 | - Even numbered resources: 103 | - Plaintext format 104 | - URI pattern: `test://static/resource/{even_number}` 105 | - Content: Simple text description 106 | 107 | - Odd numbered resources: 108 | - Binary blob format 109 | - URI pattern: `test://static/resource/{odd_number}` 110 | - Content: Base64 encoded binary data 111 | 112 | Resource features: 113 | - Supports pagination (10 items per page) 114 | - Allows subscribing to resource updates 115 | - Demonstrates resource templates 116 | - Auto-updates subscribed resources every 5 seconds 117 | 118 | ### Prompts 119 | 120 | 1. `simple_prompt` 121 | - Basic prompt without arguments 122 | - Returns: Single message exchange 123 | 124 | 2. `complex_prompt` 125 | - Advanced prompt demonstrating argument handling 126 | - Required arguments: 127 | - `temperature` (string): Temperature setting 128 | - Optional arguments: 129 | - `style` (string): Output style preference 130 | - Returns: Multi-turn conversation with images 131 | 132 | 3. `resource_prompt` 133 | - Demonstrates embedding resource references in prompts 134 | - Required arguments: 135 | - `resourceId` (number): ID of the resource to embed (1-100) 136 | - Returns: Multi-turn conversation with an embedded resource reference 137 | - Shows how to include resources directly in prompt messages 138 | 139 | ### Roots 140 | 141 | The server demonstrates the MCP roots protocol capability: 142 | 143 | - Declares `roots: { listChanged: true }` capability to indicate support for roots 144 | - Handles `roots/list_changed` notifications from clients 145 | - Requests initial roots during server initialization 146 | - Provides a `listRoots` tool to display current roots 147 | - Logs roots-related events for demonstration purposes 148 | 149 | Note: This server doesn't actually access files, but demonstrates how servers can interact with the roots protocol for clients that need to understand which directories are available for file operations. 150 | 151 | ### Logging 152 | 153 | The server sends random-leveled log messages every 15 seconds, e.g.: 154 | 155 | ```json 156 | { 157 | "method": "notifications/message", 158 | "params": { 159 | "level": "info", 160 | "data": "Info-level message" 161 | } 162 | } 163 | ``` 164 | 165 | ## Usage with Claude Desktop (uses [stdio Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#stdio)) 166 | 167 | Add to your `claude_desktop_config.json`: 168 | 169 | ```json 170 | { 171 | "mcpServers": { 172 | "everything": { 173 | "command": "npx", 174 | "args": [ 175 | "-y", 176 | "@modelcontextprotocol/server-everything" 177 | ] 178 | } 179 | } 180 | } 181 | ``` 182 | 183 | ## Usage with VS Code 184 | 185 | For quick installation, use of of the one-click install buttons below... 186 | 187 | [](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-everything%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-everything%22%5D%7D&quality=insiders) 188 | 189 | [](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Feverything%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Feverything%22%5D%7D&quality=insiders) 190 | 191 | For manual installation, you can configure the MCP server using one of these methods: 192 | 193 | **Method 1: User Configuration (Recommended)** 194 | Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. 195 | 196 | **Method 2: Workspace Configuration** 197 | Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 198 | 199 | > For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp). 200 | 201 | #### NPX 202 | 203 | ```json 204 | { 205 | "servers": { 206 | "everything": { 207 | "command": "npx", 208 | "args": ["-y", "@modelcontextprotocol/server-everything"] 209 | } 210 | } 211 | } 212 | ``` 213 | 214 | ## Running from source with [HTTP+SSE Transport](https://modelcontextprotocol.io/specification/2024-11-05/basic/transports#http-with-sse) (deprecated as of [2025-03-26](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports)) 215 | 216 | ```shell 217 | cd src/everything 218 | npm install 219 | npm run start:sse 220 | ``` 221 | 222 | ## Run from source with [Streamable HTTP Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http) 223 | 224 | ```shell 225 | cd src/everything 226 | npm install 227 | npm run start:streamableHttp 228 | ``` 229 | 230 | ## Running as an installed package 231 | ### Install 232 | ```shell 233 | npm install -g @modelcontextprotocol/server-everything@latest 234 | ```` 235 | 236 | ### Run the default (stdio) server 237 | ```shell 238 | npx @modelcontextprotocol/server-everything 239 | ``` 240 | 241 | ### Or specify stdio explicitly 242 | ```shell 243 | npx @modelcontextprotocol/server-everything stdio 244 | ``` 245 | 246 | ### Run the SSE server 247 | ```shell 248 | npx @modelcontextprotocol/server-everything sse 249 | ``` 250 | 251 | ### Run the streamable HTTP server 252 | ```shell 253 | npx @modelcontextprotocol/server-everything streamableHttp 254 | ``` 255 | 256 | ``` -------------------------------------------------------------------------------- /src/git/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # mcp-server-git: A git MCP server 2 | 3 | ## Overview 4 | 5 | A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models. 6 | 7 | Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server. 8 | 9 | ### Tools 10 | 11 | 1. `git_status` 12 | - Shows the working tree status 13 | - Input: 14 | - `repo_path` (string): Path to Git repository 15 | - Returns: Current status of working directory as text output 16 | 17 | 2. `git_diff_unstaged` 18 | - Shows changes in working directory not yet staged 19 | - Inputs: 20 | - `repo_path` (string): Path to Git repository 21 | - `context_lines` (number, optional): Number of context lines to show (default: 3) 22 | - Returns: Diff output of unstaged changes 23 | 24 | 3. `git_diff_staged` 25 | - Shows changes that are staged for commit 26 | - Inputs: 27 | - `repo_path` (string): Path to Git repository 28 | - `context_lines` (number, optional): Number of context lines to show (default: 3) 29 | - Returns: Diff output of staged changes 30 | 31 | 4. `git_diff` 32 | - Shows differences between branches or commits 33 | - Inputs: 34 | - `repo_path` (string): Path to Git repository 35 | - `target` (string): Target branch or commit to compare with 36 | - `context_lines` (number, optional): Number of context lines to show (default: 3) 37 | - Returns: Diff output comparing current state with target 38 | 39 | 5. `git_commit` 40 | - Records changes to the repository 41 | - Inputs: 42 | - `repo_path` (string): Path to Git repository 43 | - `message` (string): Commit message 44 | - Returns: Confirmation with new commit hash 45 | 46 | 6. `git_add` 47 | - Adds file contents to the staging area 48 | - Inputs: 49 | - `repo_path` (string): Path to Git repository 50 | - `files` (string[]): Array of file paths to stage 51 | - Returns: Confirmation of staged files 52 | 53 | 7. `git_reset` 54 | - Unstages all staged changes 55 | - Input: 56 | - `repo_path` (string): Path to Git repository 57 | - Returns: Confirmation of reset operation 58 | 59 | 8. `git_log` 60 | - Shows the commit logs with optional date filtering 61 | - Inputs: 62 | - `repo_path` (string): Path to Git repository 63 | - `max_count` (number, optional): Maximum number of commits to show (default: 10) 64 | - `start_timestamp` (string, optional): Start timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024') 65 | - `end_timestamp` (string, optional): End timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024') 66 | - Returns: Array of commit entries with hash, author, date, and message 67 | 68 | 9. `git_create_branch` 69 | - Creates a new branch 70 | - Inputs: 71 | - `repo_path` (string): Path to Git repository 72 | - `branch_name` (string): Name of the new branch 73 | - `start_point` (string, optional): Starting point for the new branch 74 | - Returns: Confirmation of branch creation 75 | 10. `git_checkout` 76 | - Switches branches 77 | - Inputs: 78 | - `repo_path` (string): Path to Git repository 79 | - `branch_name` (string): Name of branch to checkout 80 | - Returns: Confirmation of branch switch 81 | 11. `git_show` 82 | - Shows the contents of a commit 83 | - Inputs: 84 | - `repo_path` (string): Path to Git repository 85 | - `revision` (string): The revision (commit hash, branch name, tag) to show 86 | - Returns: Contents of the specified commit 87 | 88 | 12. `git_branch` 89 | - List Git branches 90 | - Inputs: 91 | - `repo_path` (string): Path to the Git repository. 92 | - `branch_type` (string): Whether to list local branches ('local'), remote branches ('remote') or all branches('all'). 93 | - `contains` (string, optional): The commit sha that branch should contain. Do not pass anything to this param if no commit sha is specified 94 | - `not_contains` (string, optional): The commit sha that branch should NOT contain. Do not pass anything to this param if no commit sha is specified 95 | - Returns: List of branches 96 | 97 | ## Installation 98 | 99 | ### Using uv (recommended) 100 | 101 | When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will 102 | use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-git*. 103 | 104 | ### Using PIP 105 | 106 | Alternatively you can install `mcp-server-git` via pip: 107 | 108 | ``` 109 | pip install mcp-server-git 110 | ``` 111 | 112 | After installation, you can run it as a script using: 113 | 114 | ``` 115 | python -m mcp_server_git 116 | ``` 117 | 118 | ## Configuration 119 | 120 | ### Usage with Claude Desktop 121 | 122 | Add this to your `claude_desktop_config.json`: 123 | 124 | <details> 125 | <summary>Using uvx</summary> 126 | 127 | ```json 128 | "mcpServers": { 129 | "git": { 130 | "command": "uvx", 131 | "args": ["mcp-server-git", "--repository", "path/to/git/repo"] 132 | } 133 | } 134 | ``` 135 | </details> 136 | 137 | <details> 138 | <summary>Using docker</summary> 139 | 140 | * Note: replace '/Users/username' with the a path that you want to be accessible by this tool 141 | 142 | ```json 143 | "mcpServers": { 144 | "git": { 145 | "command": "docker", 146 | "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"] 147 | } 148 | } 149 | ``` 150 | </details> 151 | 152 | <details> 153 | <summary>Using pip installation</summary> 154 | 155 | ```json 156 | "mcpServers": { 157 | "git": { 158 | "command": "python", 159 | "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"] 160 | } 161 | } 162 | ``` 163 | </details> 164 | 165 | ### Usage with VS Code 166 | 167 | For quick installation, use one of the one-click install buttons below... 168 | 169 | [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D&quality=insiders) 170 | 171 | [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D&quality=insiders) 172 | 173 | For manual installation, you can configure the MCP server using one of these methods: 174 | 175 | **Method 1: User Configuration (Recommended)** 176 | Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. 177 | 178 | **Method 2: Workspace Configuration** 179 | Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 180 | 181 | > For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp). 182 | 183 | ```json 184 | { 185 | "servers": { 186 | "git": { 187 | "command": "uvx", 188 | "args": ["mcp-server-git"] 189 | } 190 | } 191 | } 192 | ``` 193 | 194 | For Docker installation: 195 | 196 | ```json 197 | { 198 | "mcp": { 199 | "servers": { 200 | "git": { 201 | "command": "docker", 202 | "args": [ 203 | "run", 204 | "--rm", 205 | "-i", 206 | "--mount", "type=bind,src=${workspaceFolder},dst=/workspace", 207 | "mcp/git" 208 | ] 209 | } 210 | } 211 | } 212 | } 213 | ``` 214 | 215 | ### Usage with [Zed](https://github.com/zed-industries/zed) 216 | 217 | Add to your Zed settings.json: 218 | 219 | <details> 220 | <summary>Using uvx</summary> 221 | 222 | ```json 223 | "context_servers": [ 224 | "mcp-server-git": { 225 | "command": { 226 | "path": "uvx", 227 | "args": ["mcp-server-git"] 228 | } 229 | } 230 | ], 231 | ``` 232 | </details> 233 | 234 | <details> 235 | <summary>Using pip installation</summary> 236 | 237 | ```json 238 | "context_servers": { 239 | "mcp-server-git": { 240 | "command": { 241 | "path": "python", 242 | "args": ["-m", "mcp_server_git"] 243 | } 244 | } 245 | }, 246 | ``` 247 | </details> 248 | 249 | ### Usage with [Zencoder](https://zencoder.ai) 250 | 251 | 1. Go to the Zencoder menu (...) 252 | 2. From the dropdown menu, select `Agent Tools` 253 | 3. Click on the `Add Custom MCP` 254 | 4. Add the name (i.e. git) and server configuration from below, and make sure to hit the `Install` button 255 | 256 | <details> 257 | <summary>Using uvx</summary> 258 | 259 | ```json 260 | { 261 | "command": "uvx", 262 | "args": ["mcp-server-git", "--repository", "path/to/git/repo"] 263 | } 264 | ``` 265 | </details> 266 | 267 | ## Debugging 268 | 269 | You can use the MCP inspector to debug the server. For uvx installations: 270 | 271 | ``` 272 | npx @modelcontextprotocol/inspector uvx mcp-server-git 273 | ``` 274 | 275 | Or if you've installed the package in a specific directory or are developing on it: 276 | 277 | ``` 278 | cd path/to/servers/src/git 279 | npx @modelcontextprotocol/inspector uv run mcp-server-git 280 | ``` 281 | 282 | Running `tail -n 20 -f ~/Library/Logs/Claude/mcp*.log` will show the logs from the server and may 283 | help you debug any issues. 284 | 285 | ## Development 286 | 287 | If you are doing local development, there are two ways to test your changes: 288 | 289 | 1. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions. 290 | 291 | 2. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`: 292 | 293 | ### Docker 294 | 295 | ```json 296 | { 297 | "mcpServers": { 298 | "git": { 299 | "command": "docker", 300 | "args": [ 301 | "run", 302 | "--rm", 303 | "-i", 304 | "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop", 305 | "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro", 306 | "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt", 307 | "mcp/git" 308 | ] 309 | } 310 | } 311 | } 312 | ``` 313 | 314 | ### UVX 315 | ```json 316 | { 317 | "mcpServers": { 318 | "git": { 319 | "command": "uv", 320 | "args": [ 321 | "--directory", 322 | "/<path to mcp-servers>/mcp-servers/src/git", 323 | "run", 324 | "mcp-server-git" 325 | ] 326 | } 327 | } 328 | } 329 | ``` 330 | 331 | ## Build 332 | 333 | Docker build: 334 | 335 | ```bash 336 | cd src/git 337 | docker build -t mcp/git . 338 | ``` 339 | 340 | ## License 341 | 342 | This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 343 | ``` -------------------------------------------------------------------------------- /src/filesystem/README.md: -------------------------------------------------------------------------------- ```markdown 1 | # Filesystem MCP Server 2 | 3 | Node.js server implementing Model Context Protocol (MCP) for filesystem operations. 4 | 5 | ## Features 6 | 7 | - Read/write files 8 | - Create/list/delete directories 9 | - Move files/directories 10 | - Search files 11 | - Get file metadata 12 | - Dynamic directory access control via [Roots](https://modelcontextprotocol.io/docs/learn/client-concepts#roots) 13 | 14 | ## Directory Access Control 15 | 16 | The server uses a flexible directory access control system. Directories can be specified via command-line arguments or dynamically via [Roots](https://modelcontextprotocol.io/docs/learn/client-concepts#roots). 17 | 18 | ### Method 1: Command-line Arguments 19 | Specify Allowed directories when starting the server: 20 | ```bash 21 | mcp-server-filesystem /path/to/dir1 /path/to/dir2 22 | ``` 23 | 24 | ### Method 2: MCP Roots (Recommended) 25 | MCP clients that support [Roots](https://modelcontextprotocol.io/docs/learn/client-concepts#roots) can dynamically update the Allowed directories. 26 | 27 | Roots notified by Client to Server, completely replace any server-side Allowed directories when provided. 28 | 29 | **Important**: If server starts without command-line arguments AND client doesn't support roots protocol (or provides empty roots), the server will throw an error during initialization. 30 | 31 | This is the recommended method, as this enables runtime directory updates via `roots/list_changed` notifications without server restart, providing a more flexible and modern integration experience. 32 | 33 | ### How It Works 34 | 35 | The server's directory access control follows this flow: 36 | 37 | 1. **Server Startup** 38 | - Server starts with directories from command-line arguments (if provided) 39 | - If no arguments provided, server starts with empty allowed directories 40 | 41 | 2. **Client Connection & Initialization** 42 | - Client connects and sends `initialize` request with capabilities 43 | - Server checks if client supports roots protocol (`capabilities.roots`) 44 | 45 | 3. **Roots Protocol Handling** (if client supports roots) 46 | - **On initialization**: Server requests roots from client via `roots/list` 47 | - Client responds with its configured roots 48 | - Server replaces ALL allowed directories with client's roots 49 | - **On runtime updates**: Client can send `notifications/roots/list_changed` 50 | - Server requests updated roots and replaces allowed directories again 51 | 52 | 4. **Fallback Behavior** (if client doesn't support roots) 53 | - Server continues using command-line directories only 54 | - No dynamic updates possible 55 | 56 | 5. **Access Control** 57 | - All filesystem operations are restricted to allowed directories 58 | - Use `list_allowed_directories` tool to see current directories 59 | - Server requires at least ONE allowed directory to operate 60 | 61 | **Note**: The server will only allow operations within directories specified either via `args` or via Roots. 62 | 63 | 64 | 65 | ## API 66 | 67 | ### Tools 68 | 69 | - **read_text_file** 70 | - Read complete contents of a file as text 71 | - Inputs: 72 | - `path` (string) 73 | - `head` (number, optional): First N lines 74 | - `tail` (number, optional): Last N lines 75 | - Always treats the file as UTF-8 text regardless of extension 76 | - Cannot specify both `head` and `tail` simultaneously 77 | 78 | - **read_media_file** 79 | - Read an image or audio file 80 | - Inputs: 81 | - `path` (string) 82 | - Streams the file and returns base64 data with the corresponding MIME type 83 | 84 | - **read_multiple_files** 85 | - Read multiple files simultaneously 86 | - Input: `paths` (string[]) 87 | - Failed reads won't stop the entire operation 88 | 89 | - **write_file** 90 | - Create new file or overwrite existing (exercise caution with this) 91 | - Inputs: 92 | - `path` (string): File location 93 | - `content` (string): File content 94 | 95 | - **edit_file** 96 | - Make selective edits using advanced pattern matching and formatting 97 | - Features: 98 | - Line-based and multi-line content matching 99 | - Whitespace normalization with indentation preservation 100 | - Multiple simultaneous edits with correct positioning 101 | - Indentation style detection and preservation 102 | - Git-style diff output with context 103 | - Preview changes with dry run mode 104 | - Inputs: 105 | - `path` (string): File to edit 106 | - `edits` (array): List of edit operations 107 | - `oldText` (string): Text to search for (can be substring) 108 | - `newText` (string): Text to replace with 109 | - `dryRun` (boolean): Preview changes without applying (default: false) 110 | - Returns detailed diff and match information for dry runs, otherwise applies changes 111 | - Best Practice: Always use dryRun first to preview changes before applying them 112 | 113 | - **create_directory** 114 | - Create new directory or ensure it exists 115 | - Input: `path` (string) 116 | - Creates parent directories if needed 117 | - Succeeds silently if directory exists 118 | 119 | - **list_directory** 120 | - List directory contents with [FILE] or [DIR] prefixes 121 | - Input: `path` (string) 122 | 123 | - **list_directory_with_sizes** 124 | - List directory contents with [FILE] or [DIR] prefixes, including file sizes 125 | - Inputs: 126 | - `path` (string): Directory path to list 127 | - `sortBy` (string, optional): Sort entries by "name" or "size" (default: "name") 128 | - Returns detailed listing with file sizes and summary statistics 129 | - Shows total files, directories, and combined size 130 | 131 | - **move_file** 132 | - Move or rename files and directories 133 | - Inputs: 134 | - `source` (string) 135 | - `destination` (string) 136 | - Fails if destination exists 137 | 138 | - **search_files** 139 | - Recursively search for files/directories that match or do not match patterns 140 | - Inputs: 141 | - `path` (string): Starting directory 142 | - `pattern` (string): Search pattern 143 | - `excludePatterns` (string[]): Exclude any patterns. 144 | - Glob-style pattern matching 145 | - Returns full paths to matches 146 | 147 | - **directory_tree** 148 | - Get recursive JSON tree structure of directory contents 149 | - Inputs: 150 | - `path` (string): Starting directory 151 | - `excludePatterns` (string[]): Exclude any patterns. Glob formats are supported. 152 | - Returns: 153 | - JSON array where each entry contains: 154 | - `name` (string): File/directory name 155 | - `type` ('file'|'directory'): Entry type 156 | - `children` (array): Present only for directories 157 | - Empty array for empty directories 158 | - Omitted for files 159 | - Output is formatted with 2-space indentation for readability 160 | 161 | - **get_file_info** 162 | - Get detailed file/directory metadata 163 | - Input: `path` (string) 164 | - Returns: 165 | - Size 166 | - Creation time 167 | - Modified time 168 | - Access time 169 | - Type (file/directory) 170 | - Permissions 171 | 172 | - **list_allowed_directories** 173 | - List all directories the server is allowed to access 174 | - No input required 175 | - Returns: 176 | - Directories that this server can read/write from 177 | 178 | ## Usage with Claude Desktop 179 | Add this to your `claude_desktop_config.json`: 180 | 181 | Note: you can provide sandboxed directories to the server by mounting them to `/projects`. Adding the `ro` flag will make the directory readonly by the server. 182 | 183 | ### Docker 184 | Note: all directories must be mounted to `/projects` by default. 185 | 186 | ```json 187 | { 188 | "mcpServers": { 189 | "filesystem": { 190 | "command": "docker", 191 | "args": [ 192 | "run", 193 | "-i", 194 | "--rm", 195 | "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop", 196 | "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro", 197 | "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt", 198 | "mcp/filesystem", 199 | "/projects" 200 | ] 201 | } 202 | } 203 | } 204 | ``` 205 | 206 | ### NPX 207 | 208 | ```json 209 | { 210 | "mcpServers": { 211 | "filesystem": { 212 | "command": "npx", 213 | "args": [ 214 | "-y", 215 | "@modelcontextprotocol/server-filesystem", 216 | "/Users/username/Desktop", 217 | "/path/to/other/allowed/dir" 218 | ] 219 | } 220 | } 221 | } 222 | ``` 223 | 224 | ## Usage with VS Code 225 | 226 | For quick installation, click the installation buttons below... 227 | 228 | [](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-filesystem%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-filesystem%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D&quality=insiders) 229 | 230 | [](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fprojects%2Fworkspace%22%2C%22mcp%2Ffilesystem%22%2C%22%2Fprojects%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fprojects%2Fworkspace%22%2C%22mcp%2Ffilesystem%22%2C%22%2Fprojects%22%5D%7D&quality=insiders) 231 | 232 | For manual installation, you can configure the MCP server using one of these methods: 233 | 234 | **Method 1: User Configuration (Recommended)** 235 | Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. 236 | 237 | **Method 2: Workspace Configuration** 238 | Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. 239 | 240 | > For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp). 241 | 242 | You can provide sandboxed directories to the server by mounting them to `/projects`. Adding the `ro` flag will make the directory readonly by the server. 243 | 244 | ### Docker 245 | Note: all directories must be mounted to `/projects` by default. 246 | 247 | ```json 248 | { 249 | "servers": { 250 | "filesystem": { 251 | "command": "docker", 252 | "args": [ 253 | "run", 254 | "-i", 255 | "--rm", 256 | "--mount", "type=bind,src=${workspaceFolder},dst=/projects/workspace", 257 | "mcp/filesystem", 258 | "/projects" 259 | ] 260 | } 261 | } 262 | } 263 | ``` 264 | 265 | ### NPX 266 | 267 | ```json 268 | { 269 | "servers": { 270 | "filesystem": { 271 | "command": "npx", 272 | "args": [ 273 | "-y", 274 | "@modelcontextprotocol/server-filesystem", 275 | "${workspaceFolder}" 276 | ] 277 | } 278 | } 279 | } 280 | ``` 281 | 282 | ## Build 283 | 284 | Docker build: 285 | 286 | ```bash 287 | docker build -t mcp/filesystem -f src/filesystem/Dockerfile . 288 | ``` 289 | 290 | ## License 291 | 292 | This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. 293 | ```