Created
December 11, 2025 15:04
-
-
Save cdbkr/df688bf00b644fa5088d900f13f62b3b to your computer and use it in GitHub Desktop.
main function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function main() { | |
| const spec = await loadSpec(CONFIG.specPath); | |
| const baseUrl = spec.servers?.[0]?.url || ''; | |
| const groups = groupEndpoints(spec); | |
| const mcp = new FastMCP({ | |
| name: 'mcp-example', | |
| version: '1.0.0', | |
| }); | |
| groups.forEach((endpoints, resource) => { | |
| const tool = createResourceTool(resource, endpoints, baseUrl); | |
| mcp.addTool(tool); | |
| }); | |
| await mcp.start(); | |
| } | |
| main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment