smithery/study-flamingo

mcp-test

Test an MCP server locally. Use to verify tools, resources, and prompts work correctly.

Installation

$ npx skills add smithery/study-flamingo --skill mcp-test

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/study-flamingo.

npx skills add smithery/study-flamingo

Browse all from smithery/study-flamingo

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,621 B
  • docs SUMMARY.md 103 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Test MCP Server

When invoked, test the MCP server to verify it works correctly.

Testing Methods

  1. Direct invocation - Run server and call methods
  2. MCP Inspector - Interactive debugging tool
  3. Claude Desktop - Test in real environment
  4. Unit tests - Automated testing

Python (FastMCP) Testing

Test Client

import pytest
from fastmcp.testing import TestClient
from my_server.server import mcp

@pytest.fixture
def client():
    return TestClient(mcp)

async def test_hello_tool(client):
    """Test the hello tool returns correct greeting."""
    result = await client.call_tool("hello", {"name": "World"})
    assert "Hello, World" in result.content[0].text

async def test_search_with_filters(client):
    """Test search tool with filter parameters."""
    result = await client.call_tool("search", {
        "query": "test",
        "limit": 5
    })
    data = json.loads(result.content[0].text)
    assert len(data) <= 5

async def test_resource(client):
    """Test resource returns expected data."""
    result = await client.read_resource("config://app")
    config = json.loads(result.contents[0].text)
    assert "version" in config

Run Tests

# Run all tests
pytest -v

# Run specific test
pytest tests/test_server.py::test_hello_tool -v

# Run with coverage
pytest --cov=my_server tests/

TypeScript Testing

Test Setup

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';
import { Client } from '@modelcontextprotocol/sdk/client/index.js';

describe('MCP Server', () => {
  let server: McpServer;
  let client: Client;

  beforeEach(async () => {
    server = createServer();  // Your server factory
    client = new Client({ name: 'test-client', version: '1.0.0' });

    const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
    await server.connect(serverTransport);
    await client.connect(clientTransport);
  });

  afterEach(async () => {
    await client.close();
  });

  it('should list tools', async () => {
    const tools = await client.listTools();
    expect(tools.tools.length).toBeGreaterThan(0);
  });

  it('should call hello tool', async () => {
    const result = await client.callTool({
      name: 'hello',
      arguments: { name: 'World' }
    });
    expect(result.content[0].text).toContain('Hello, World');
  });
});

MCP Inspector

The MCP Inspector provides interactive debugging:

# Install
npx @anthropic-ai/mcp-inspector

# Run with your server
npx @anthropic-ai/mcp-inspector python -m my_server.server
npx @anthropic-ai/mcp-inspector node dist/index.js

Features:

  • List all tools, resources, prompts
  • Call tools interactively
  • Read resources
  • View request/response logs

Claude Desktop Testing

Add to Claude Desktop config

macOS: ~/Library/Application Support/Claude/claudedesktopconfig.json Windows: %APPDATA%\Claude\claudedesktopconfig.json

{
  "mcpServers": {
    "my-server": {
      "command": "python",
      "args": ["-m", "my_server.server"]
    }
  }
}

For TypeScript:

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/path/to/dist/index.js"]
    }
  }
}

Verify in Claude

  1. Restart Claude Desktop
  2. Check MCP icon shows your server
  3. Ask Claude to use a tool from your server
  4. Verify output is correct

Manual Testing

stdio transport

# Start server
python -m my_server.server

# Send JSON-RPC request via stdin
{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}

# Call a tool
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"hello","arguments":{"name":"World"}}}

HTTP transport

# Start server
python -m my_server.server --transport http --port 8000

# List tools
curl -X POST http://localhost:8000/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

# Call tool
curl -X POST http://localhost:8000/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"hello","arguments":{"name":"World"}}}'

Test Checklist

  • All tools return expected output
  • Error cases handled gracefully
  • Resources return valid data
  • Authentication works (if configured)
  • Works in Claude Desktop
  • No hanging processes or memory leaks