build-your-own-mcp
v1.0.7
Published
Scaffold a starter MCP server project
Downloads
962
Readme
Scaffold a starter MCP server with a tool, resource, and prompt.
build-your-own-mcp
Table of contents
Getting started
npx build-your-own-mcp my-mcp-server
cd my-mcp-serverThis scaffolds a new project, installs dependencies, and initialises a git repository.
What you get
Project structure
my-mcp-server/
src/
index.js # MCP server with stub callbacks
database.js # JSON file helpers for journal entries
docs/
creating_a_tool.md
creating_a_resource.md
creating_a_prompt.md
package.jsonStarter primitives
The server registers three MCP primitives with empty callbacks for you to fill in:
| Primitive | Name | Description |
| ---------- | -------------- | ----------------------------------- |
| Tool | create-entry | Create a new journal entry |
| Resource | entries | List all journal entries as JSON |
| Prompt | reflect | Reflect on recent journal entries |
Guides
Each guide walks you through implementing one primitive and includes the completed solution:
docs/creating_a_tool.mddocs/creating_a_resource.mddocs/creating_a_prompt.md
Running
npm startThe server communicates over stdio. To use it with Claude Code, add it to your MCP configuration:
{
"mcpServers": {
"journal": {
"command": "node",
"args": ["path/to/my-mcp-server/src/index.js"]
}
}
}