Skip to content

Serve registries as APIs

One route table, multiple protocols.

Expose a normalized ToolRegistry as multiple API endpoints, with authentication, configuration, and deployment primitives built around a central RouteTable.

PyPI version CI License: MIT

What is toolregistry-server?

toolregistry-server is the serving layer in the ToolRegistry ecosystem. It takes a ToolRegistry full of Python functions and exposes them as network services — REST APIs via OpenAPI, or LLM tool interfaces via the Model Context Protocol (MCP).

toolregistry (core)         → define & manage tools
toolregistry-server (this)  → serve tools over OpenAPI & MCP
toolregistry-hub (extras)   → curated, ready-to-use tools

Quick Start

pip install toolregistry-server[all]
from toolregistry import ToolRegistry
from toolregistry_server import RouteTable
from toolregistry_server.openapi import create_openapi_app

registry = ToolRegistry()

@registry.register
def greet(name: str) -> str:
    """Greet someone by name."""
    return f"Hello, {name}!"

route_table = RouteTable(registry)
app = create_openapi_app(route_table)

Installation → · Quick Start → · Examples →

Key Features

  • Central Route Table — unified routing layer bridging ToolRegistry and protocol adapters
  • OpenAPI Adapter — RESTful HTTP endpoints with automatic schema generation
  • MCP AdapterModel Context Protocol for LLM integration
  • Authentication — built-in Bearer token support
  • CLI — run servers from config files without writing code
  • Dynamic Enable/Disable — toggle tools at runtime without restart
  • ETag Caching — efficient HTTP caching via ETag headers

Architecture

graph TD
    TR[ToolRegistry<br/>tool definitions]
    RT[RouteTable<br/>central routing layer<br/><i>RouteEntry · RouteEntry · ...</i>]
    OA[OpenAPI Adapter<br/>FastAPI · REST]
    MA[MCP Adapter<br/>MCP SDK · LLM integration]
    GA[gRPC Adapter<br/>future]

    TR --> RT
    RT --> OA
    RT --> MA
    RT -.-> GA

License

ToolRegistry Server is licensed under the MIT License.