mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-29 08:06:46 +00:00
Replay recordings load without credentials; the MCP tool panel lists tools over POST when requested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
841 B
Rust
22 lines
841 B
Rust
#[cfg(feature = "mcp")]
|
|
use axum::routing::post;
|
|
use axum::Router;
|
|
|
|
/// Wraps the subcrate's workspaced_service with the mcp_tools routes
|
|
/// that depend on windmill-api internals.
|
|
pub fn workspaced_service() -> Router {
|
|
let router = windmill_store::resources::workspaced_service();
|
|
|
|
#[cfg(feature = "mcp")]
|
|
use crate::mcp_tools::{call_mcp_tool, get_mcp_tools};
|
|
// Listing tools sends the caller's resolved secrets to the URL the resource names, so it
|
|
// is a POST: the `SameSite=Lax` session cookie rides on a cross-site link or redirect to a
|
|
// GET, which would let anyone who can share a link pick the resource for the caller.
|
|
#[cfg(feature = "mcp")]
|
|
let router = router
|
|
.route("/mcp_tools/{*path}", post(get_mcp_tools))
|
|
.route("/mcp_call_tool/{*path}", post(call_mcp_tool));
|
|
|
|
router
|
|
}
|