@yogeliu/mcp-server-yapi
Version:
Enhanced YAPI MCP server with multi-project support and enterprise features
27 lines • 915 B
JavaScript
import { MCPTool } from "mcp-framework";
import { yapiGet } from "../utils/yapi-request.js";
import { INTERFACE_ENDPOINTS } from "../constants/yapi-endpoints.js";
import { InterfaceSchema, ProjectNameSchema } from "../schemas/interface-schemas.js";
const ListInterfaceSchema = InterfaceSchema.pick({
project_id: true,
page: true,
limit: true,
}).partial({
page: true,
limit: true,
}).merge(ProjectNameSchema);
class ListInterface extends MCPTool {
name = "list_interface";
description = "Get interface list data";
schema = ListInterfaceSchema;
async execute(input) {
const { project_name, ...apiParams } = input;
const params = {
...apiParams,
limit: input.limit || 2000
};
return await yapiGet(INTERFACE_ENDPOINTS.LIST, params, project_name);
}
}
export default ListInterface;
//# sourceMappingURL=ListInterface.js.map