Skip to main content

Agent Load Protocol — drop-in MCP/SSE middleware for any Python server

Project description

alp-server

Agent Load Protocol — drop-in MCP/SSE middleware for any Python server.

Add Kiro / Claude Code / MCP connectivity to any existing FastAPI or Flask app in 3 lines.

Install

pip install alp-server

FastAPI

from fastapi import FastAPI
from alp import ALPRouter

app = FastAPI()

# Adds /mcp, /agent, /tools, /persona, /agents, /health, /agent/refresh
alp = ALPRouter(card_path="agent.alp.json")
app.include_router(alp.router)

# Your existing routes — untouched
@app.get("/your/existing/route")
async def your_route():
    return {"ok": True}
uvicorn main:app --port 8000

Flask

pip install alp-server[flask]
from flask import Flask
from alp.flask import ALPBlueprint

app = Flask(__name__)

alp = ALPBlueprint(card_path="agent.alp.json")
app.register_blueprint(alp.blueprint)

Custom tool registration

Register Python functions as tool handlers instead of using proxy URLs:

from fastapi import FastAPI
from alp import ALPRouter

app = FastAPI()
alp = ALPRouter(card_path="agent.alp.json")

@alp.tool("greet")
async def greet(input_data: dict) -> dict:
    name = input_data.get("name", "stranger")
    return {"message": f"Hello, {name}!"}

@alp.tool("search")
async def search(input_data: dict) -> dict:
    results = my_search_function(input_data["query"])
    return {"results": results}

app.include_router(alp.router)

Remote card (v0.6.0)

Load the Agent Card from a public GitHub URL:

alp = ALPRouter(
    card_url="https://raw.githubusercontent.com/YOUR-ORG/YOUR-REPO/main/agent.alp.json"
)

Or via environment variable:

AGENT_CARD_URL=https://raw.githubusercontent.com/YOUR-ORG/YOUR-REPO/main/agent.alp.json

Connect to Kiro

Add to .kiro/settings/mcp.json:

{
  "mcpServers": {
    "my-agent": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Endpoints added

Endpoint Description
GET /mcp MCP SSE stream — Kiro connects here
POST /mcp MCP JSON-RPC receiver
GET /agent Agent Card JSON
GET /agent/refresh Re-fetch remote card
GET /persona Agent persona for system prompt
GET /tools Tool list
POST /tools/{name} Execute a tool
GET /agents All hosted cards
GET /health Status check

Protocol

Part of the Agent Load Protocol.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alp_server-0.7.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alp_server-0.7.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file alp_server-0.7.0.tar.gz.

File metadata

  • Download URL: alp_server-0.7.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for alp_server-0.7.0.tar.gz
Algorithm Hash digest
SHA256 6c696d018bb27a4e229c1b2dbe456528e7293ca2deb1fa2ba5284caad4b00102
MD5 d71c8b614b33e36c846509e1e73c3e1c
BLAKE2b-256 33679bbaad9f64d57a9c59c02a67e8d2b5a7d1a744ee906583ed7084f3fcca57

See more details on using hashes here.

File details

Details for the file alp_server-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: alp_server-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for alp_server-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a44f4de40c4dc4b39568ed19a2a28a5a7a9db979802af2b559dd840a4e100013
MD5 fe83ccd4d024f53ae84bc1be39afdf4c
BLAKE2b-256 ce32abe22b035d8d0d93dce822553f5b093af018977251dc7b5667eba578a017

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page