Skip to content

Commit cd66777

Browse files
authored
Merge pull request #986 from Zy0ung/feature/smithery-deploy-setting
feat: smtihery에 올릴 기능 index.ts에 작성
2 parents 07e8376 + 3a41b7c commit cd66777

File tree

1 file changed

+7
-93
lines changed

1 file changed

+7
-93
lines changed

packages/mcp/src/index.ts

Lines changed: 7 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
/**
2-
* 👋 Welcome to your Smithery project!
3-
* To run your server, run "npm run dev"
4-
*
5-
* You might find these resources useful:
6-
*
7-
* 🧑‍💻 MCP's TypeScript SDK (helps you define your server)
8-
* https://github.com/modelcontextprotocol/typescript-sdk
9-
*
10-
* 📝 smithery.yaml (defines user-level config, like settings or API keys)
11-
* https://smithery.ai/docs/build/project-config/smithery-yaml
12-
*
13-
* 💻 smithery CLI (run "npx @smithery/cli dev" or explore other commands below)
14-
* https://smithery.ai/docs/concepts/cli
15-
*/
16-
171
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
182
import { z } from "zod";
3+
import { registerStorylineUITool } from "./tools/storyLineUI/storyLineUITool.js";
4+
import { registerAnalysisTools } from "./tools/analysis/register.js";
195

20-
// Optional: If you have user-level config, define it here
21-
// This should map to the config in your smithery.yaml file
226
export const configSchema = z.object({
237
debug: z.boolean().default(false).describe("Enable debug logging"),
248
});
@@ -27,86 +11,16 @@ export default function createStatelessServer({
2711
config,
2812
sessionId,
2913
}: {
30-
config: z.infer<typeof configSchema>; // Define your config in smithery.yaml
31-
sessionId: string; // Use the sessionId field for mapping requests to stateful processes
14+
config: z.infer<typeof configSchema>;
15+
sessionId: string;
3216
}) {
3317
const server = new McpServer({
34-
name: "My MCP Server",
18+
name: "Githru MCP Server",
3519
version: "1.0.0",
3620
});
3721

38-
// Add a tool
39-
server.tool(
40-
"hello",
41-
"Say hello to someone",
42-
{
43-
name: z.string().describe("Name to greet"),
44-
},
45-
async ({ name }) => {
46-
return {
47-
content: [{ type: "text", text: `Hello, ${name}!` }],
48-
};
49-
}
50-
);
51-
52-
server.registerTool(
53-
"ping",
54-
{
55-
title: "Ping",
56-
description: "Health check tool",
57-
inputSchema: {}
58-
},
59-
async () => {
60-
return { content: [{ type: "text", text: "pong" }] };
61-
}
62-
);
63-
64-
server.registerTool(
65-
"echo",
66-
{
67-
title: "Echo",
68-
description: "Echoes back the input text",
69-
inputSchema: {
70-
text: z.string().describe("Text to echo back")
71-
}
72-
},
73-
async ({ text }) => {
74-
return { content: [{ type: "text", text: `Echo: ${text}` }] };
75-
}
76-
);
77-
78-
server.registerTool(
79-
"bmi_calculator",
80-
{
81-
title: "BMI Calculator",
82-
description: "키(cm)와 몸무게(kg)를 입력받아 BMI 지수를 계산합니다.",
83-
inputSchema: {
84-
height: z.number().int().positive().describe("키 (cm 단위)"),
85-
weight: z.number().int().positive().describe("몸무게 (kg 단위)")
86-
}
87-
},
88-
89-
async ({ height, weight }) => {
90-
const hMeters = height / 100; // cm → m
91-
const bmi = weight / (hMeters * hMeters);
92-
let category = "Unknown";
93-
if (bmi < 18.5) category = "Underweight";
94-
else if (bmi < 24.9) category = "Normal weight";
95-
else if (bmi < 29.9) category = "Overweight";
96-
else category = "Obese";
97-
98-
return {
99-
content: [
100-
{
101-
type: "text",
102-
text: `Height: ${height} cm, Weight: ${weight} kg\nBMI: ${bmi.toFixed(
103-
2
104-
)} (${category})`
105-
}
106-
]
107-
};
108-
}
109-
);
22+
registerAnalysisTools(server);
23+
registerStorylineUITool(server);
11024

11125
return server.server;
11226
}

0 commit comments

Comments
 (0)