Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
5de886c
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 3, 2025
8845118
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 5, 2025
1c64b36
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 5, 2025
daec74f
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 5, 2025
d868b1c
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 5, 2025
eee9866
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 5, 2025
7435291
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 5, 2025
0aeb8a7
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 6, 2025
9084cd3
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 6, 2025
7b2ff6b
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 6, 2025
07867a5
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 7, 2025
8559fbd
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 7, 2025
16ed059
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 8, 2025
346c29a
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 8, 2025
1df8623
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 8, 2025
0f3e27e
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
df844b5
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
08b6a50
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
2ce87b1
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
0bf6c69
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
328a990
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
320e3d8
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 9, 2025
8530747
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
03d3da0
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
27793ac
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
6cd26cf
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
904d0ea
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
f759d9e
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
7acadf4
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
48bf94a
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 10, 2025
3d003ab
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 11, 2025
2afc618
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 11, 2025
339e056
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 11, 2025
ea6fe27
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 11, 2025
18ef6aa
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 12, 2025
cb073d8
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 12, 2025
9b25a3a
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 13, 2025
2093f2d
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 13, 2025
1157890
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 13, 2025
19e588b
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 13, 2025
f561f70
[WIP] Refactor everything server to be more modular and use recommend…
cliffhall Dec 13, 2025
c5999b5
Merge branch 'main' into new-everything-server
cliffhall Dec 13, 2025
a008d9f
Updated structure.md
cliffhall Dec 13, 2025
2b60822
Refactor-renamed long-running-operation.ts to trigger-long-running-op…
cliffhall Dec 13, 2025
919b2e0
Updated AGENTS.md with guidance on tool naming
cliffhall Dec 13, 2025
a235ed8
Updated package.json and ran prettier
cliffhall Dec 13, 2025
79c4e51
Update README.md and doc in server/index.ts
cliffhall Dec 13, 2025
90d1b66
Update doc in server/index.ts
cliffhall Dec 13, 2025
cb5f70c
Update doc in server/index.ts
cliffhall Dec 13, 2025
299aae2
Update doc in tools/toggle-subscriber-updates.ts
cliffhall Dec 13, 2025
3f5e5cf
Update doc in tools/trigger-elicitation-request.ts
cliffhall Dec 13, 2025
00b8c53
Update doc in tools/trigger-long-running-operation.ts
cliffhall Dec 13, 2025
8291c0b
Update doc in tools/trigger-elicitation-request.ts
cliffhall Dec 13, 2025
b8074f9
Update doc in tools/trigger-elicitation-request.ts and trigger-long-r…
cliffhall Dec 13, 2025
45ea1e2
Update doc in tools/toggle-subscriber-updates.ts
cliffhall Dec 13, 2025
ba09842
Update doc in tools/toggle-subscriber-updates.ts
cliffhall Dec 13, 2025
cd5b728
Update doc in tools/toggle-subscriber-updates.ts
cliffhall Dec 13, 2025
77deef0
Update doc in tools/gzip-file-as-resource.ts
cliffhall Dec 13, 2025
6854902
Use roots cache in get-roots-list tool
cliffhall Dec 13, 2025
e1c1dcf
Use roots cache in get-roots-list tool
cliffhall Dec 13, 2025
8126179
Run pretter:fix
cliffhall Dec 13, 2025
6ad8af7
Updated doc in get-resource-reference.ts
cliffhall Dec 13, 2025
82cda36
Updated doc in get-env.ts
cliffhall Dec 13, 2025
29a20bf
Updated doc in get-annotated-message.ts
cliffhall Dec 13, 2025
0ba86f8
Updated doc in echo.ts
cliffhall Dec 13, 2025
eed70bb
Updated doc in trigger-sampling-request.ts
cliffhall Dec 13, 2025
7b85925
Updated doc in all tools
cliffhall Dec 13, 2025
20527e4
Updated doc in all tools
cliffhall Dec 13, 2025
cdbcdc5
Cache roots in get-roots-list.ts if list was not already present and …
cliffhall Dec 13, 2025
e0f1c42
Add listChanged capability for tools, prompts, and resources in serve…
cliffhall Dec 15, 2025
70feb6f
Remove `includeContext: "thisServer"` from CreateMessageRequest in tr…
cliffhall Dec 15, 2025
734d5c3
Updated server instructions.md. See https://github.com/modelcontextpr…
cliffhall Dec 15, 2025
8758a11
Updated server instructions.md. See https://github.com/modelcontextpr…
cliffhall Dec 15, 2025
ebac631
Updated server instructions.md. See https://github.com/modelcontextpr…
cliffhall Dec 15, 2025
1b8f376
Demonstrate registration of tools conditioned upon client capability …
cliffhall Dec 15, 2025
c6daef7
Get roots unconditionally when syncRoots is called
cliffhall Dec 16, 2025
17a2be2
Merge branch 'main' into new-everything-server
cliffhall Dec 17, 2025
f8933ec
Sync roots at startup. This was deferred to list_roots tool is used, …
cliffhall Dec 17, 2025
17aaa45
Sync roots at startup. This was deferred to list_roots tool is used, …
cliffhall Dec 17, 2025
5fb7a71
Merge branch 'main' into new-everything-server
cliffhall Dec 18, 2025
53cc385
Update src/everything/AGENTS.md
cliffhall Dec 18, 2025
44faf3a
Remove console log statements
cliffhall Dec 19, 2025
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
62 changes: 56 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/everything/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages
dist
README.md
node_modules
52 changes: 52 additions & 0 deletions src/everything/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# MCP "Everything" Server - Development Guidelines

## Build, Test & Run Commands

- Build: `npm run build` - Compiles TypeScript to JavaScript
- 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
- Prepare release: `npm run prepare` - Builds the project for publishing

## Code Style Guidelines

- Use ES modules with `.js` extension in import paths
- Strictly type all functions and variables with TypeScript
- Follow zod schema patterns for tool input validation
- Prefer async/await over callbacks and Promise chains
- Place all imports at top of file, grouped by external then internal
- Use descriptive variable names that clearly indicate purpose
- Implement proper cleanup for timers and resources in server shutdown
- Handle errors with try/catch blocks and provide clear error messages
- Use consistent indentation (2 spaces) and trailing commas in multi-line objects
- Match existing code style, import order, and module layout in the respective folder.
- Use camelCase for variables/functions,
- Use PascalCase for types/classes,
- Use UPPER_CASE for constants
- Use kebab-case for file names and registered tools, prompts, and resources.
- Use verbs for tool names, e.g., `get-annotated-message` instead of `annotated-message`

## Extending the Server

The Everything Server is designed to be extended at well-defined points.
See [Extension Points](docs/extension.md) and [Project Structure](docs/structure.md).
The server factory is `src/everything/server/index.ts` and registers all features during startup as well as handling post-connection setup.

### High-level

- Tools live under `src/everything/tools/` and are registered via `registerTools(server)`.
- Resources live under `src/everything/resources/` and are registered via `registerResources(server)`.
- Prompts live under `src/everything/prompts/` and are registered via `registerPrompts(server)`.
- Subscriptions and simulated update routines are under `src/everything/resources/subscriptions.ts`.
- Logging helpers are under `src/everything/server/logging.ts`.
- Transport managers are under `src/everything/transports/`.

### When adding a new feature

- Follow the existing file/module pattern in its folder (naming, exports, and registration function).
- Export a `registerX(server)` function that registers new items with the MCP SDK in the same style as existing ones.
- Wire your new module into the central index (e.g., update `tools/index.ts`, `resources/index.ts`, or `prompts/index.ts`).
- Ensure schemas (for tools) are accurate JSON Schema and include helpful descriptions and examples.
`server/index.ts` and usages in `logging.ts` and `subscriptions.ts`.
- Keep the docs in `src/everything/docs/` up to date if you add or modify noteworthy features.
20 changes: 0 additions & 20 deletions src/everything/CLAUDE.md

This file was deleted.

167 changes: 9 additions & 158 deletions src/everything/README.md
Original file line number Diff line number Diff line change
@@ -1,166 +1,17 @@
# Everything MCP Server
**[Architecture](docs/architecture.md)
| [Project Structure](docs/structure.md)
| [Startup Process](docs/startup.md)
| [Server Features](docs/features.md)
| [Extension Points](docs/extension.md)
| [How It Works](docs/how-it-works.md)**


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.

## Components

### Tools

1. `echo`
- Simple tool to echo back input messages
- Input:
- `message` (string): Message to echo back
- Returns: Text content with echoed message

2. `add`
- Adds two numbers together
- Inputs:
- `a` (number): First number
- `b` (number): Second number
- Returns: Text result of the addition

3. `longRunningOperation`
- Demonstrates progress notifications for long operations
- Inputs:
- `duration` (number, default: 10): Duration in seconds
- `steps` (number, default: 5): Number of progress steps
- Returns: Completion message with duration and steps
- Sends progress notifications during execution

4. `printEnv`
- Prints all environment variables
- Useful for debugging MCP server configuration
- No inputs required
- Returns: JSON string of all environment variables

5. `sampleLLM`
- Demonstrates LLM sampling capability using MCP sampling feature
- Inputs:
- `prompt` (string): The prompt to send to the LLM
- `maxTokens` (number, default: 100): Maximum tokens to generate
- Returns: Generated LLM response

6. `getTinyImage`
- Returns a small test image
- No inputs required
- Returns: Base64 encoded PNG image data

7. `annotatedMessage`
- Demonstrates how annotations can be used to provide metadata about content
- Inputs:
- `messageType` (enum: "error" | "success" | "debug"): Type of message to demonstrate different annotation patterns
- `includeImage` (boolean, default: false): Whether to include an example image
- Returns: Content with varying annotations:
- Error messages: High priority (1.0), visible to both user and assistant
- Success messages: Medium priority (0.7), user-focused
- Debug messages: Low priority (0.3), assistant-focused
- Optional image: Medium priority (0.5), user-focused
- Example annotations:
```json
{
"priority": 1.0,
"audience": ["user", "assistant"]
}
```

8. `getResourceReference`
- Returns a resource reference that can be used by MCP clients
- Inputs:
- `resourceId` (number, 1-100): ID of the resource to reference
- Returns: A resource reference with:
- Text introduction
- Embedded resource with `type: "resource"`
- Text instruction for using the resource URI

9. `startElicitation`
- Initiates an elicitation (interaction) within the MCP client.
- Inputs:
- `color` (string): Favorite color
- `number` (number, 1-100): Favorite number
- `pets` (enum): Favorite pet
- Returns: Confirmation of the elicitation demo with selection summary.

10. `structuredContent`
- Demonstrates a tool returning structured content using the example in the specification
- Provides an output schema to allow testing of client SHOULD advisory to validate the result using the schema
- Inputs:
- `location` (string): A location or ZIP code, mock data is returned regardless of value
- Returns: a response with
- `structuredContent` field conformant to the output schema
- A backward compatible Text Content field, a SHOULD advisory in the specification

11. `listRoots`
- Lists the current MCP roots provided by the client
- Demonstrates the roots protocol capability even though this server doesn't access files
- No inputs required
- Returns: List of current roots with their URIs and names, or a message if no roots are set
- Shows how servers can interact with the MCP roots protocol

### Resources

The server provides 100 test resources in two formats:
- Even numbered resources:
- Plaintext format
- URI pattern: `test://static/resource/{even_number}`
- Content: Simple text description

- Odd numbered resources:
- Binary blob format
- URI pattern: `test://static/resource/{odd_number}`
- Content: Base64 encoded binary data

Resource features:
- Supports pagination (10 items per page)
- Allows subscribing to resource updates
- Demonstrates resource templates
- Auto-updates subscribed resources every 5 seconds

### Prompts

1. `simple_prompt`
- Basic prompt without arguments
- Returns: Single message exchange

2. `complex_prompt`
- Advanced prompt demonstrating argument handling
- Required arguments:
- `temperature` (string): Temperature setting
- Optional arguments:
- `style` (string): Output style preference
- Returns: Multi-turn conversation with images

3. `resource_prompt`
- Demonstrates embedding resource references in prompts
- Required arguments:
- `resourceId` (number): ID of the resource to embed (1-100)
- Returns: Multi-turn conversation with an embedded resource reference
- Shows how to include resources directly in prompt messages

### Roots

The server demonstrates the MCP roots protocol capability:

- Declares `roots: { listChanged: true }` capability to indicate support for roots
- Handles `roots/list_changed` notifications from clients
- Requests initial roots during server initialization
- Provides a `listRoots` tool to display current roots
- Logs roots-related events for demonstration purposes

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.

### Logging

The server sends random-leveled log messages every 15 seconds, e.g.:
## Tools, Resources, Prompts, and Other Features

```json
{
"method": "notifications/message",
"params": {
"level": "info",
"data": "Info-level message"
}
}
```
A complete list of the registered MCP primitives and other protocol features demonstrated can be found in the [Server Features](docs/features.md) document.

## Usage with Claude Desktop (uses [stdio Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#stdio))

Expand Down
Loading