-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
44 lines (39 loc) · 968 Bytes
/
index.js
File metadata and controls
44 lines (39 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import { searchWeb } from "./tools/searchWeb.js";
import { analyzeRepoPrompt } from "./prompts/analyzeRepo.js";
const server = new McpServer({
name: "Falcon's MCP Server",
description: "A server for Falcon's MCP",
version: "0.0.1",
});
server.tool(
"searchWebWithQuery",
{
query: z.string(),
},
async ({ query }) => {
return {
content: [{ type: "text", text: JSON.stringify(await searchWeb(query)) }],
};
}
);
server.prompt(
"analyzeRepo",
{
functionality: z.string(),
},
({ functionality }) => {
return {
content: [
{ type: "text", text: String(analyzeRepoPrompt(functionality)) },
],
};
}
);
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
}
main();