feat: add Model Context Protocol (MCP) SSE endpoint

Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-23 12:57:00 -03:00
parent f2eabd65b0
commit 925c978bbc
7 changed files with 622 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
pub mod item;
pub mod status;
pub mod mcp;
use axum::{
routing::get,
@@ -30,6 +31,7 @@ use utoipa_swagger_ui::SwaggerUi;
item::handle_get_item,
item::handle_get_item_meta,
item::handle_get_item_content,
mcp::handle_mcp_sse,
),
components(
schemas(
@@ -45,7 +47,8 @@ use utoipa_swagger_ui::SwaggerUi;
),
tags(
(name = "status", description = "System status and health check endpoints"),
(name = "item", description = "Item management endpoints for storing, retrieving, and managing content with metadata")
(name = "item", description = "Item management endpoints for storing, retrieving, and managing content with metadata"),
(name = "mcp", description = "Model Context Protocol endpoints for AI tool integration")
),
servers(
(url = "/", description = "Local server")
@@ -66,6 +69,9 @@ pub fn add_routes(router: Router<AppState>) -> Router<AppState> {
.route("/api/item/{item_id}", get(item::handle_get_item))
.route("/api/item/{item_id}/meta", get(item::handle_get_item_meta))
.route("/api/item/{item_id}/content", get(item::handle_get_item_content))
// MCP endpoints
.route("/mcp/sse", get(mcp::handle_mcp_sse))
}
pub fn add_docs_routes(router: Router<AppState>) -> Router<AppState> {