This repository contains multiple MCP (Model Context Protocol) server examples and a client testing tool. Each project demonstrates different aspects of building and working with MCP servers.
- Ex1 - MCP: Math MCP Server - Provides basic mathematical operations and math jokes
- Ex3 - Priv Esc: Todo List MCP Server - Manages todo lists for users (Alice and Bob)
- Ex4 - Select server: Weather MCP Server - Returns weather-related jokes
- mcp-lite: MCP Client Tester - A tool for testing and interacting with MCP servers
- Node.js >= 18.0.0
- npm >= 9.0.0
To check your versions:
node --version
npm --versionEach project has its own dependencies. Navigate to each project directory and install dependencies:
cd "Ex1 - MCP"
npm installcd "Ex3 - Priv Esc"
npm installcd "Ex4 - Select server"
npm installcd mcp-lite
npm installOptional - Install globally:
cd mcp-lite
npm install -gThis makes the mcp-client command available globally.
A server that provides mathematical operations and math jokes.
cd "Ex1 - MCP"
npm startOr directly:
node src/index.js- add: Add two numbers (
{ "a": 5, "b": 3 }) - subtract: Subtract two numbers (
{ "a": 10, "b": 4 }) - multiply: Multiply two numbers (
{ "a": 7, "b": 6 }) - divide: Divide two numbers (
{ "a": 20, "b": 4 }) - power: Raise a number to a power (
{ "base": 2, "exponent": 8 }) - get_math_joke: Get a random math joke (
{})
Add to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"math-server": {
"command": "/Users/katiepaxtonfear/Documents/MCP Course Code/Ex1 - MCP/run-server.sh"
}
}
}Note: Update the path to match your actual project location. Make sure run-server.sh is executable:
chmod +x "Ex1 - MCP/run-server.sh"A server that manages todo lists for users (Alice and Bob).
cd "Ex3 - Priv Esc"
npm startOr directly:
node src/index.js-
get_todos: Get all todos for a user
{ "email": "alice@example.com" } -
create_todo: Create a new todo for a user
{ "email": "bob@example.com", "title": "Review pull request #123", "priority": "high", "status": "pending" } -
mark_todo_complete: Mark a todo as completed
{ "email": "alice@example.com", "todo_id": 1 }
Add to your Claude Desktop config file:
{
"mcpServers": {
"todo-list-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex3 - Priv Esc/src/index.js"
]
}
}
}Note: Update the path to match your actual project location.
A server that returns weather-related jokes (with a humorous twist).
cd "Ex4 - Select server"
npm startOr directly:
node src/index.js- forecast: Get a weather forecast (actually returns a weather-related joke)
{}
Add to your Claude Desktop config file:
{
"mcpServers": {
"weather-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex4 - Select server/src/index.js"
]
}
}
}Note: Update the path to match your actual project location.
A command-line tool for testing and interacting with MCP servers. Useful for security testing, tool enumeration, and server configuration analysis.
Create an MCPserver.json file in the mcp-lite directory (or specify a custom path with --config):
{
"mcpServers": {
"math-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex1 - MCP/src/index.js"
]
},
"todo-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex3 - Priv Esc/src/index.js"
]
},
"weather-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex4 - Select server/src/index.js"
]
}
}
}Note: Update all paths to match your actual project locations.
List all tools from all servers:
cd mcp-lite
npm start -- list
# or if installed globally:
mcp-client listList tools from a specific server:
npm start -- list --server math-server
# or
mcp-client list --server math-serverList all configured servers:
npm start -- servers
# or
mcp-client serversGet server information:
npm start -- info math-server
# or
mcp-client info math-serverGenerate a tool call template:
npm start -- generate math-server add
# or
mcp-client generate math-server addCall a tool:
npm start -- call math-server add --args '{"a":5,"b":3}'
# or
mcp-client call math-server add --args '{"a":5,"b":3}'Call a tool with arguments from a file:
npm start -- call math-server add --args-file ./args.json
# or
mcp-client call math-server add --args-file ./args.jsonJSON output (for automation):
npm start -- list --json
# or
mcp-client list --jsonCustom configuration file:
npm start -- list --config /path/to/config.json
# or
mcp-client list --config /path/to/config.jsonFor more detailed usage information, see the mcp-lite README.
To use multiple servers with Claude Desktop, merge all server configurations into a single mcpServers object:
macOS location: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows location: %APPDATA%\Claude\claude_desktop_config.json
Example combined configuration:
{
"mcpServers": {
"math-server": {
"command": "/Users/katiepaxtonfear/Documents/MCP Course Code/Ex1 - MCP/run-server.sh"
},
"todo-list-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex3 - Priv Esc/src/index.js"
]
},
"weather-server": {
"command": "node",
"args": [
"/Users/katiepaxtonfear/Documents/MCP Course Code/Ex4 - Select server/src/index.js"
]
}
}
}Important Notes:
- Update all paths to match your actual project locations
- Find your Node.js path with
which node(macOS/Linux) orwhere node(Windows) - Make sure
run-server.shis executable:chmod +x "Ex1 - MCP/run-server.sh" - After updating the config, restart Claude Desktop
-
Check Node.js installation:
which node # macOS/Linux where node # Windows
-
Verify dependencies are installed:
cd <project-directory> npm install
-
Test the server manually:
cd <project-directory> npm start
-
Check file permissions (for shell scripts):
chmod +x "Ex1 - MCP/run-server.sh"
- Check Claude Desktop logs for error messages
- Verify paths in the configuration file are correct and absolute
- Restart Claude Desktop after making configuration changes
- Test servers manually first to ensure they work independently
- Verify server configuration in
MCPserver.json - Check that server commands are available in your PATH
- Ensure required environment variables are set (if any)
- Test servers individually using
npm startin each project directory
MCP Course Code/
├── Ex1 - MCP/ # Math MCP Server
│ ├── src/
│ │ └── index.js
│ ├── package.json
│ ├── run-server.sh
│ └── claude_desktop_config.json
├── Ex3 - Priv Esc/ # Todo List MCP Server
│ ├── src/
│ │ └── index.js
│ ├── package.json
│ └── claude_desktop_config.json
├── Ex4 - Select server/ # Weather MCP Server
│ ├── src/
│ │ └── index.js
│ ├── package.json
│ └── claude_desktop_config.json
└── mcp-lite/ # MCP Client Tester
├── src/
│ ├── cli.js
│ ├── mcp-client.js
│ └── oauth-provider.js
├── package.json
└── MCPserver.json.example
- Each project has its own detailed README with specific usage instructions
- See individual project READMEs for more examples and detailed documentation
- MCP Documentation
All projects in this repository are licensed under MIT.