Skip to main content
Glama

QMCP - Model Context Protocol Server

A spec-aligned Model Context Protocol (MCP) server built with FastAPI.

Features

  • Tool Discovery - List available tools via /v1/tools

  • Tool Invocation - Execute tools via /v1/tools/{name}

  • Invocation History - Audit trail via /v1/invocations

  • Human-in-the-Loop - Request human input via /v1/human/*

  • Persistence - SQLite with SQLModel/aiosqlite

  • Python Client - qmcp.client.MCPClient for workflows

  • Metaflow Examples - Ready-to-use flow templates

  • Structured Logging - JSON logs with structlog

  • Request Tracing - Correlation IDs across requests

  • Metrics - Prometheus-compatible /metrics endpoint

  • CLI Interface - Manage via qmcp command

Quick Start

# Install dependencies uv sync # Start the server uv run qmcp serve # Or with development reload uv run qmcp serve --reload

Client Library

from qmcp.client import MCPClient with MCPClient(base_url="http://localhost:8000") as client: # List tools tools = client.list_tools() # Invoke a tool result = client.invoke_tool("echo", {"message": "Hello!"}) print(result.result) # Human-in-the-loop request = client.create_human_request( request_id="approval-001", request_type="approval", prompt="Approve deployment?", options=["approve", "reject"] ) response = client.wait_for_response("approval-001", timeout=3600)

See docs/client.md for full API documentation.

CLI Commands

# Start the server qmcp serve [--host HOST] [--port PORT] [--reload] # List registered tools qmcp tools list # Show configuration qmcp info # Run tests with auto setup/teardown qmcp test [-v] [--coverage] [TEST_PATH]

API Endpoints

Endpoint

Method

Description

/health

GET

Health check

/v1/tools

GET

List available tools

/v1/tools/{name}

POST

Invoke a tool

/v1/invocations

GET

List invocation history

/v1/invocations/{id}

GET

Get single invocation

/v1/human/requests

POST

Create human request

/v1/human/requests

GET

List human requests

/v1/human/requests/{id}

GET

Get request with response

/v1/human/responses

POST

Submit human response

/metrics

GET

Prometheus metrics

/metrics/json

GET

Metrics as JSON

Built-in Tools

  • echo - Echo input back (for testing)

  • planner - Create execution plans

  • executor - Execute approved plans

  • reviewer - Review and assess results

Development

# Install dev dependencies uv sync --all-extras # Run tests (with auto cleanup) uv run qmcp test -v # Run tests with coverage uv run qmcp test --coverage # Run linter uv run ruff check .

Architecture

See docs/architecture.md for the full architectural overview.

The system follows a three-plane architecture:

  1. Client/Orchestration - Metaflow workflows (MCP client)

  2. MCP Server - FastAPI service (this project)

  3. Execution/Storage - Tools and database

Documentation

Example Flows

See examples/flows/ for Metaflow integration examples:

  • simple_plan.py - Basic tool invocation

  • approved_deploy.py - HITL approval workflow

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/quaternionmedia/qmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server