Skip to main content
Glama
mdz-axo

PT-MCP (Paul Test Man Context Protocol)

by mdz-axo
index.ts2.5 kB
/** * Resource registration and handlers */ import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { ReadResourceRequestSchema } from "@modelcontextprotocol/sdk/types.js"; export function registerResources(server: Server) { server.setRequestHandler(ReadResourceRequestSchema, async (request) => { const { uri } = request.params; try { // Parse URI to extract resource type and path const uriPattern = /^context:\/\/([^/]+)\/(.+)$/; const match = uri.match(uriPattern); if (!match) { throw new Error(`Invalid resource URI: ${uri}`); } const [, resourceType, path] = match; switch (resourceType) { case "project": // Return cached project context return { contents: [ { uri, mimeType: "application/json", text: JSON.stringify( { message: "Project context resource - implementation pending", path, }, null, 2 ), }, ], }; case "patterns": // Return detected patterns return { contents: [ { uri, mimeType: "application/json", text: JSON.stringify( { message: "Patterns resource - implementation pending", path, }, null, 2 ), }, ], }; case "dependencies": // Return dependency graph return { contents: [ { uri, mimeType: "application/json", text: JSON.stringify( { message: "Dependencies resource - implementation pending", path, }, null, 2 ), }, ], }; default: throw new Error(`Unknown resource type: ${resourceType}`); } } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); throw new Error(`Error reading resource: ${errorMessage}`); } }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mdz-axo/pt-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server