|
1 | 1 | # Everything MCP Server |
| 2 | +**[Architecture](docs/architecture.md) |
| 3 | +| [Project Structure](docs/structure.md) |
| 4 | +| [Startup Process](docs/startup.md) |
| 5 | +| [Server Features](docs/features.md) |
| 6 | +| [Extension Points](docs/extension.md) |
| 7 | +| [How It Works](docs/how-it-works.md)** |
| 8 | + |
2 | 9 |
|
3 | 10 | 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 | 11 |
|
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.: |
| 12 | +## Tools, Resources, Prompts, and Other Features |
154 | 13 |
|
155 | | -```json |
156 | | -{ |
157 | | - "method": "notifications/message", |
158 | | - "params": { |
159 | | - "level": "info", |
160 | | - "data": "Info-level message" |
161 | | - } |
162 | | -} |
163 | | -``` |
| 14 | +A complete list of the registered MCP primitives and other protocol features demonstrated can be found in the [Server Features](docs/features.md) document. |
164 | 15 |
|
165 | 16 | ## Usage with Claude Desktop (uses [stdio Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#stdio)) |
166 | 17 |
|
|
0 commit comments