A JSON-RPC 2.0 compliant server implementing the Model Context Protocol (MCP) for note management (as an example)
This is an example. You can modify this and use as a Boilerplate for your own project. It supports cross-platform development and includes a command-line interface and service component for both development and release builds.
cmd
)The command-line interface provides direct access to the notes server functionality.
service
)The service component enables system-level integration and background operation.
The server implements a note storage system with:
note://
URI scheme for accessing individual notesAvailable prompts:
summarize-notes
: Creates summaries of all stored notes
style
argument ("brief"/"detailed")Available tools:
add-note
: Adds a new note to the server
name
(string), content
(string)Development builds (includes debug symbols and race detection):
# Build all components for all platforms
make dev
# Build for specific platform
make dev-windows
make dev-linux
make dev-darwin
# Build specific components
make build-cmd
make build-service
Release builds (optimized and stripped):
# Build all components for all platforms
make release-all
# Build for specific platform
make release-windows
make release-linux
make release-darwin
Run locally:
# Run command-line interface
make run-cmd
# Run service
make run-service
View all available targets:
make help
Binaries are created in the bin
directory:
bin/dev/<platform>/
bin/release/<platform>/
Configure the notes server in Claude Desktop's configuration file:
~/Library/Application\ Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"notes-server": {
"command": "./bin/dev/<platform>/notes-server",
"args": []
}
}
}
{
"mcpServers": {
"notes-server": {
"command": "./bin/release/<platform>/notes-service",
"args": []
}
}
}
.
├── cmd/ # Command-line interface
├── service/ # Service implementation
├── internal/
│ └── server/ # Core server implementation
│ ├── operations.go # Server operations
│ ├── server.go # Main server logic
│ └── types.go # Type definitions
├── Makefile # Build configuration
└── README.md
Since the server runs over stdio, we recommend using the MCP Inspector for debugging:
npx @modelcontextprotocol/inspector ./bin/dev/<platform>/notes-server
The Inspector will provide a URL for the debugging interface.
The server implements standard JSON-RPC 2.0 error codes plus custom codes:
Code | Description | Standard |
---|---|---|
-32700 | Parse error | Yes |
-32600 | Invalid request | Yes |
-32601 | Method not found | Yes |
-32602 | Invalid params | Yes |
-32603 | Internal error | Yes |
-32001 | Resource not found | No |
-32002 | Unsupported operation | No |
MIT License
Copyright (c) 2024 Andrew Lee Donelson
{
"mcpServers": {
"notes-server": {
"env": {},
"args": [],
"command": "npx"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.