learn-mcp

learn-mcp

A learning MCP server with tools, resources, prompts, and sampling for AI clients like Cursor, using local JSON storage.

Category
Visit Server

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:

  1. Go to Settings → MCP and confirm learn-mcp is connected
  2. Use Agent mode to invoke tools and read resources
  3. 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 dev in MCP config — npm prints to stdout and breaks the JSON-RPC transport. Always use tsx src/index.ts or node build/index.js directly.

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/createMessage and the user approves the request
  • Cursor may not fully support sampling yet — if create-random-user fails with Method not found, use create-user instead

Development notes

  • Use registerTool(), registerResource(), and registerPrompt() — the older .tool(), .resource(), and .prompt() methods are deprecated
  • Resource templates need a list callback for Cursor to discover individual URIs
  • Use console.error() for debug logs — never console.log() on stdio transport (stdout is reserved for JSON-RPC)
  • McpServer constructor takes two arguments: server info (name, version) and options (capabilities, etc.)

License

ISC

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured