Skip to main content
Glama

APISIX-MCP

by api7
route.ts816 B
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import makeAdminAPIRequest from "../utils/adminAPI.js"; import { CreateRouteSchema, UpdateRouteSchema } from "../schemas/route.js"; const setupRouteTools = (server: McpServer) => { server.tool("create_route", "Create a route", CreateRouteSchema.shape, async (args) => { const routeId = args.id; if (routeId) { return await makeAdminAPIRequest(`/routes/${routeId}`, "PUT", args.route); } else { return await makeAdminAPIRequest(`/routes`, "POST", args.route); } }); server.tool("update_route", "Update specific attributes of an existing route", UpdateRouteSchema.shape, async (args) => { return await makeAdminAPIRequest(`/routes/${args.id}`, "PATCH", args.route); }); }; export default setupRouteTools;

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/api7/apisix-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server