Practice
A Model Context Protocol (MCP) practice project demonstrating server/client implementation with user management tools, resources, and prompts. Built with TypeScript, Node.js v24, and Google Gemini AI integration.
Installation
npx mcp-practiceAsk AI about Practice
Powered by Claude Β· Grounded in docs
I know everything about Practice. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MCP Practice Project
A Model Context Protocol (MCP) server and client implementation for learning and practicing MCP development. This project demonstrates how to build an MCP server that exposes resources, tools, and prompts, along with an interactive CLI client to interact with them.
Features
MCP Server (src/server.ts):
- Resources: Query user data via
users://allandusers://{userId}/profile - Tools:
create-user- Create a user with explicit fields (name, email, address, phone)create-random-user- Generate a random user using LLM sampling
- Prompts:
generate-fake-user- Generate fake user data based on a name
MCP Client (src/client.ts):
- Interactive CLI for testing MCP server capabilities
- Query tools, resources, and prompts
- Natural language query interface using Google Gemini AI
Tech Stack
- Runtime: Node.js v24.10.0
- Language: TypeScript (strict mode, ES modules)
- Framework: Model Context Protocol SDK (
@modelcontextprotocol/sdk) - AI: Google Gemini API (
@ai-sdk/google) - Validation: Zod
- Storage: JSON file (
src/data/users.json)
Quick Start
# Install dependencies
npm install
# Build the server
npm run server:build
# Run the server (for MCP Inspector)
npm run server:inspect
# Run the interactive client
npm run client:dev
Project Structure
src/
βββ server.ts # MCP server implementation
βββ client.ts # MCP client CLI
βββ data/
βββ users.json # JSON-based user database
Development
This is a practice/learning project for understanding MCP development patterns. The server uses StdioServerTransport for communication, and data is stored in a simple JSON file (not production-ready).
