Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# CLAUDE.md

This file provides guidance to Claude Code when working with code in this repository.

## Project Overview

Official MCP reference server implementations. This is an npm workspaces monorepo containing 7 servers (4 TypeScript, 3 Python) under `src/`. Each server is a standalone package published to npm or PyPI.

## Monorepo Structure

```
src/
everything/ TS @modelcontextprotocol/server-everything (reference server, all MCP features)
filesystem/ TS @modelcontextprotocol/server-filesystem (file operations with Roots access control)
memory/ TS @modelcontextprotocol/server-memory (knowledge graph persistence)
sequentialthinking/ TS @modelcontextprotocol/server-sequential-thinking (step-by-step reasoning)
fetch/ Py mcp-server-fetch (web content fetching)
git/ Py mcp-server-git (git repository operations)
time/ Py mcp-server-time (timezone queries and conversion)
```

## Build & Test Commands

### TypeScript servers

```bash
# Single server
cd src/<server> && npm ci && npm run build && npm test

# All TS servers from root
npm install && npm run build
```

- Build: `tsc` (target ES2022, module Node16, strict mode)
- Tests: **vitest** with `@vitest/coverage-v8` (required for new tests)
- Node version: **22**

### Python servers

```bash
cd src/<server> && uv sync --frozen --all-extras --dev

# Run tests (if tests/ or test/ directory exists)
uv run pytest

# Type checking
uv run pyright

# Linting
uv run ruff check .
```

- Build system: **hatchling** (`uv build`)
- Package manager: **uv** (not pip)
- Python version: **>= 3.10** (per-server `.python-version` file)
- Type checking: **pyright** (enforced in CI)
- Linting: **ruff**

## Code Style

### TypeScript

- ES modules with `.js` extension in import paths
- Strict TypeScript typing for all functions and variables
- Zod schemas for tool input validation
- 2-space indentation, trailing commas in multi-line objects
- camelCase for variables/functions, PascalCase for types/classes, UPPER_CASE for constants
- kebab-case for file names and registered tools/prompts/resources
- Verb-first tool names (e.g., `get-file-info`, not `file-info`)
- Imports grouped: external first, then internal

### Python

- Type hints enforced via pyright
- Async/await patterns (especially in fetch server with pytest-asyncio)
- Follow existing module layout per server

## Contributing Guidelines

**Accepted:** Bug fixes, usability improvements, enhancements demonstrating MCP protocol features (Resources, Prompts, Roots -- not just Tools).

**Selective:** New features outside a server's core purpose or highly opinionated additions.

**Not accepted:** New server implementations (use the [MCP Server Registry](https://github.com/modelcontextprotocol/registry)), README server listing changes.

## CI/CD Pipeline

Both TypeScript and Python workflows use **dynamic package detection** (find + jq matrix strategy):

1. `detect-packages` -- finds all `package.json` / `pyproject.toml` under `src/`
2. `test` -- runs tests per package
3. `build` -- compiles and type-checks per package
4. `publish` -- on release events only (npm for TS, PyPI trusted publishing for Python)

## MCP Protocol Reference

The repo is configured with an MCP docs server (`.mcp.json`) pointing to `https://modelcontextprotocol.io/mcp`. For schema details, reference `https://github.com/modelcontextprotocol/modelcontextprotocol/tree/main/schema` which contains versioned schemas in JSON and TypeScript formats.

## Key Patterns

- Each server registers capabilities via `registerTools(server)`, `registerResources(server)`, `registerPrompts(server)` functions
- Tool annotations: set `readOnlyHint`, `idempotentHint`, `destructiveHint` per MCP spec
- Transport support: stdio (default), SSE (deprecated), Streamable HTTP
- All PRs are reviewed against the [PR template](.github/pull_request_template.md) checklist -- ensure MCP docs are read, security best practices followed, and changes tested with an LLM client
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,19 @@ However, running a server on its own isn't very useful, and should instead be co
}
```

On Windows, wrap `npx` with `cmd /c`:

```json
{
"mcpServers": {
"memory": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-memory"]
}
}
}
```

Additional examples of using the Claude Desktop as an MCP client might look like:

```json
Expand Down Expand Up @@ -215,6 +228,8 @@ Additional examples of using the Claude Desktop as an MCP client might look like
}
```

On Windows, apply the same wrapper to each `npx`-based entry above by changing `"command"` to `"cmd"` and prepending `"/c", "npx"` to the existing `args`. Leave `uvx` entries unchanged.

## 🛠️ Creating Your Own Server

Interested in creating your own MCP server? Visit the official documentation at [modelcontextprotocol.io](https://modelcontextprotocol.io/introduction) for comprehensive guides, best practices, and technical details on implementing MCP servers.
Expand Down
2 changes: 1 addition & 1 deletion src/everything/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Watch mode: `npm run watch` - Watches for changes and rebuilds automatically
- Run STDIO server: `npm run start:stdio` - Starts the MCP server using stdio transport
- Run SSE server: `npm run start:sse` - Starts the MCP server with SSE transport
- Run StreamableHttp server: `npm run start:stremableHttp` - Starts the MCP server with StreamableHttp transport
- Run StreamableHttp server: `npm run start:streamableHttp` - Starts the MCP server with StreamableHttp transport
- Prepare release: `npm run prepare` - Builds the project for publishing

## Code Style Guidelines
Expand Down
34 changes: 32 additions & 2 deletions src/everything/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,27 @@ Add to your `claude_desktop_config.json`:
}
```

On Windows, use `cmd /c` to launch `npx`:

```json
{
"mcpServers": {
"everything": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-everything"
]
}
}
}
```

## Usage with VS Code

For quick installation, use of of the one-click install buttons below...
For quick installation, use one of the one-click install buttons below...

[![Install with NPX in VS Code](https://img.shields.io/badge/VS_Code-NPM-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](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) [![Install with NPX in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](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)

Expand Down Expand Up @@ -62,6 +80,19 @@ Alternatively, you can add the configuration to a file called `.vscode/mcp.json`
}
```

On Windows, use:

```json
{
"servers": {
"everything": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-everything"]
}
}
}
```

## 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))

```shell
Expand Down Expand Up @@ -103,4 +134,3 @@ npx @modelcontextprotocol/server-everything sse
```shell
npx @modelcontextprotocol/server-everything streamableHttp
```

39 changes: 39 additions & 0 deletions src/filesystem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,26 @@ Note: all directories must be mounted to `/projects` by default.
}
```

On Windows, use `cmd /c` to launch `npx`:

```json
{
"mcpServers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
```

## Usage with VS Code

For quick installation, click the installation buttons below...
Expand Down Expand Up @@ -308,6 +328,25 @@ Note: all directories must be mounted to `/projects` by default.
}
```

On Windows, use:

```json
{
"servers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
}
}
}
```

## Build

Docker build:
Expand Down
2 changes: 1 addition & 1 deletion src/git/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Add this to your `claude_desktop_config.json`:
<details>
<summary>Using docker</summary>

* Note: replace '/Users/username' with the a path that you want to be accessible by this tool
* Note: replace '/Users/username' with a path that you want to be accessible by this tool

```json
"mcpServers": {
Expand Down
57 changes: 57 additions & 0 deletions src/memory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ Add this to your claude_desktop_config.json:
}
```

On Windows, use `cmd /c` to launch `npx`:

```json
{
"mcpServers": {
"memory": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}
```

#### NPX with custom setting

The server can be configured using the following environment variables:
Expand All @@ -180,6 +198,27 @@ The server can be configured using the following environment variables:
}
```

On Windows, use:

```json
{
"mcpServers": {
"memory": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-memory"
],
"env": {
"MEMORY_FILE_PATH": "/path/to/custom/memory.jsonl"
}
}
}
}
```

- `MEMORY_FILE_PATH`: Path to the memory storage JSONL file (default: `memory.jsonl` in the server directory)

# VS Code Installation Instructions
Expand Down Expand Up @@ -216,6 +255,24 @@ Alternatively, you can add the configuration to a file called `.vscode/mcp.json`
}
```

On Windows, use:

```json
{
"servers": {
"memory": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-memory"
]
}
}
}
```

#### Docker

```json
Expand Down
Loading
Loading