learn-mcp
A learning MCP server with tools, resources, prompts, and sampling for AI clients like Cursor, using local JSON storage.
README
learn-mcp
A learning MCP (Model Context Protocol) server built with the official TypeScript SDK. It exposes tools, resources, prompts, and sampling to AI clients like Cursor.
Data is stored in a local JSON file (src/data/users.json) — no external database required.
Features
Tools
| Tool | Description |
|---|---|
create-user |
Create a user with name, email, address, and phone |
create-random-user |
Uses MCP sampling to ask the client's AI to generate a fake user, then saves it |
Resources
| Resource | URI | Description |
|---|---|---|
users |
users://all |
All users (static resource) |
user-details |
users://{userId}/profile |
Single user by ID (resource template) |
Prompts
| Prompt | Args | Description |
|---|---|---|
generate-fake-name |
name |
Returns a message template asking the AI to generate a fake user for a given name |
Prerequisites
- Node.js 18+
- npm
Getting started
# Install dependencies
npm install
# Build TypeScript (optional — Cursor config uses tsx directly)
npm run build
Scripts
| Command | Description |
|---|---|
npm run build |
Compile TypeScript to build/ |
npm run build:watch |
Recompile on file changes |
npm start |
Run compiled server (node build/index.js) |
npm run mcp |
Run server via tsx (development) |
npm run dev |
Run with tsx watch mode |
npm run inspect |
Open MCP Inspector in the browser |
Cursor setup
This project includes .cursor/mcp.json:
{
"mcpServers": {
"learn-mcp": {
"type": "stdio",
"command": "npx",
"args": ["tsx", "src/index.ts"],
"cwd": "${workspaceFolder}"
}
}
}
After opening the project in Cursor:
- Go to Settings → MCP and confirm
learn-mcpis connected - Use Agent mode to invoke tools and read resources
- Reload the window if the server doesn't appear (
Ctrl+Shift+P→ "Developer: Reload Window")
Example prompts in Cursor
Create a user named Alice with email alice@example.com, address 42 Oak St, phone 555-1234
Show me all users
Read users://5/profile
Use the generate-fake-name prompt with name "Jared Leto"
MCP Inspector
Test tools, resources, and prompts without Cursor:
npm run inspect
Open the URL printed in the terminal (usually http://localhost:6274).
Stdio rule: Never run the server through
npm run devin MCP config — npm prints to stdout and breaks the JSON-RPC transport. Always usetsx src/index.tsornode build/index.jsdirectly.
Project structure
├── .cursor/
│ └── mcp.json # Cursor MCP configuration
├── src/
│ ├── index.ts # Server entry point
│ └── data/
│ └── users.json # User "database"
├── build/ # Compiled output (gitignored)
├── package.json
├── tsconfig.json
└── README.md
Transport
Uses stdio — the client spawns the server process and communicates over stdin/stdout. This is the standard setup for local MCP servers in Cursor and Claude Desktop.
Sampling note
create-random-user calls sampling/createMessage, which asks the client (not the server) to run an LLM and return generated text. This requires the client to support the sampling capability.
- Works when the client implements
sampling/createMessageand the user approves the request - Cursor may not fully support sampling yet — if
create-random-userfails withMethod not found, usecreate-userinstead
Development notes
- Use
registerTool(),registerResource(), andregisterPrompt()— the older.tool(),.resource(), and.prompt()methods are deprecated - Resource templates need a
listcallback for Cursor to discover individual URIs - Use
console.error()for debug logs — neverconsole.log()on stdio transport (stdout is reserved for JSON-RPC) McpServerconstructor takes two arguments: server info (name,version) and options (capabilities, etc.)
License
ISC
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.