arcade-mcp/libs/arcade-serve
Evan Tahler a921b76ce9
Add tool name and version to otel spans for worker (#690)
Knowing which tools we called seems important

<img width="1554" height="293" alt="Screenshot 2025-11-20 at 1 36 48 PM"
src="https://github.com/user-attachments/assets/1b3cf297-749f-4ea1-9d1c-606707540d5b"
/>

Closes PLT-748
2025-11-21 15:53:54 -08:00
..
arcade_serve Add tool name and version to otel spans for worker (#690) 2025-11-21 15:53:54 -08:00
pyproject.toml Worker Stability (#688) 2025-11-20 11:13:41 -08:00
README.md PyPI release arcade-serve and arcade-tdk (#432) 2025-06-13 13:06:11 -07:00

Arcade Serve

Serving infrastructure for Arcade tools and workers.

Overview

Arcade Serve provides the infrastructure for serving Arcade tools:

  • FastAPI Worker: High-performance FastAPI-based worker implementation
  • MCP Server: Model Context Protocol server for tool integration
  • Core Abstractions: Base worker classes and components
  • Authentication: Auth utilities and routing
  • Runtime Management: Tool execution and lifecycle management

Installation

pip install arcade-serve

Usage

To add a toolkit to a hosted worker such as FastAPI, you can register them in the worker itself. This allows you to explicitly define which tools should be included on a particular worker.

Here is an example of adding the math toolkit (pip install arcade-math) to a FastAPI Worker:

import arcade_math
from fastapi import FastAPI
from arcade_tdk import Toolkit
from arcade_serve.fastapi import FastAPIWorker

app = FastAPI()

worker_secret = os.environ.get("ARCADE_WORKER_SECRET")
worker = FastAPIWorker(app, secret=worker_secret)

worker.register_toolkit(Toolkit.from_module(arcade_math))

Here is an example of adding the math toolkit (pip install arcade-math) to a MCP Worker

import arcade_math
from arcade_core.catalog import ToolCatalog
from arcade_serve.mcp.stdio import StdioServer

# 1. Create and populate the tool catalog
catalog = ToolCatalog()
catalog.add_module(arcade_math)


# 2. Main entrypoint
async def main():
    # Create the worker with the tool catalog
    worker = StdioServer(catalog)

    # Run the worker
    await worker.run()


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())

License

MIT License - see LICENSE file for details.