Skip to content

Commit

Permalink
simplify file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
keturiosakys committed Dec 11, 2024
1 parent a8cbc1b commit 20c1a88
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 52 deletions.
51 changes: 45 additions & 6 deletions packages/mcp-server/src/index.ts → packages/mcp-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,55 @@ import {
type CallToolRequest,
CallToolRequestSchema,
ListToolsRequestSchema,
type Tool,
} from "@modelcontextprotocol/sdk/types.js";
import {
getSpansForTraceTool,
listAllRegisteredRoutesTool,
listAllRequestsTool,
listTracesTool,
} from "./tools.js";

const DEFAULT_FIBERPLANE_STUDIO_URL = "http://localhost:8788";

// Tool definitions
const listTracesTool: Tool = {
name: "fiberplane_list_traces",
description:
"Retrieves a list of all traces, showing the root spans for each trace",
inputSchema: {
type: "object",
properties: {},
},
};

const getSpansForTraceTool: Tool = {
name: "fiberplane_get_spans_for_trace",
description: "Retrieves all spans for a specific trace ID",
inputSchema: {
type: "object",
properties: {
traceId: {
type: "string",
description: "The ID of the trace to fetch spans for",
},
},
required: ["traceId"],
},
};

const listAllRegisteredRoutesTool: Tool = {
name: "fiberplane_list_all_registered_routes",
description: "Lists all registered routes in the studio",
inputSchema: {
type: "object",
properties: {},
},
};

const listAllRequestsTool: Tool = {
name: "fiberplane_list_all_requests",
description: "Lists all requests, logged in the studio",
inputSchema: {
type: "object",
properties: {},
},
};

async function main() {
console.log("Starting Fiberplane MCP Server ...");

Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fiberplane/mcp-server-fiberplane",
"type": "module",
"version": "0.1.0",
"version": "0.1.1",
"access": "public",
"description": "MCP server for Fiberplane Studio",
"main": "dist/index.js",
Expand Down
44 changes: 0 additions & 44 deletions packages/mcp-server/src/tools.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/mcp-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"skipLibCheck": true
},
"include": [
"src/**/*.ts"
"index.ts",
],
"exclude": [
"node_modules",
Expand Down

0 comments on commit 20c1a88

Please sign in to comment.