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.1.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.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alp_server-0.7.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7434649c277baeb1072810c44831df151ba25392e4ecebe481b6748cc07d5c43
MD5 97eb4efc5c5eebd64e9de129e8eb4c67
BLAKE2b-256 53653878b31525ec558804ad6c7a4304c8cec3df6dc5d432624698e9fed8ea62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alp_server-0.7.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9bd050a712d6ff388131f383865f24b7d422fa8f4201c46c831bd7905c0b6582
MD5 d2cb75c94264115eecfdee3d4c9b8e6b
BLAKE2b-256 7036aac94afb3484a6dadaa969da2668f034b77951dd03f606d4c5fd19abad5e

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