From 0d2d4bf0fd924a404c3929f61ff40759683912cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CBeeRad=E2=80=9D?= Date: Thu, 29 Jan 2026 15:42:49 +1100 Subject: [PATCH] feat(rah-light): remove extraction tools from MCP servers - Remove rah_extract_url, rah_extract_youtube, rah_extract_pdf tools - These tools called API endpoints that don't exist (/api/extract/*) - MCP servers now expose 11 tools (down from 14): - Node CRUD: add, search, update, get - Edge CRUD: create, query, update - Dimension CRUD: create, update, delete - Semantic search: search_embeddings Co-Authored-By: Claude Opus 4.5 --- apps/mcp-server/server.js | 123 -------------------------------- apps/mcp-server/stdio-server.js | 123 -------------------------------- 2 files changed, 246 deletions(-) diff --git a/apps/mcp-server/server.js b/apps/mcp-server/server.js index eb6af05..590ec79 100644 --- a/apps/mcp-server/server.js +++ b/apps/mcp-server/server.js @@ -253,45 +253,6 @@ const searchEmbeddingsOutputSchema = { ) }; -// rah_extract_url schemas -const extractUrlInputSchema = { - url: z.string().url().describe('URL of the webpage to extract content from') -}; - -const extractUrlOutputSchema = { - success: z.boolean(), - title: z.string(), - content: z.string(), - chunk: z.string(), - metadata: z.record(z.any()) -}; - -// rah_extract_youtube schemas -const extractYoutubeInputSchema = { - url: z.string().describe('YouTube video URL to extract transcript from') -}; - -const extractYoutubeOutputSchema = { - success: z.boolean(), - title: z.string(), - channel: z.string(), - transcript: z.string(), - metadata: z.record(z.any()) -}; - -// rah_extract_pdf schemas -const extractPdfInputSchema = { - url: z.string().url().describe('URL of the PDF file to extract content from') -}; - -const extractPdfOutputSchema = { - success: z.boolean(), - title: z.string(), - content: z.string(), - chunk: z.string(), - metadata: z.record(z.any()) -}; - async function resolveBaseUrl() { try { const value = await baseUrlResolver(); @@ -722,90 +683,6 @@ mcpServer.registerTool( } ); -mcpServer.registerTool( - 'rah_extract_url', - { - title: 'Extract URL content', - description: 'Extract content from a webpage URL. Returns title, content, and metadata for creating nodes.', - inputSchema: extractUrlInputSchema, - outputSchema: extractUrlOutputSchema - }, - async ({ url }) => { - const result = await callRaHApi('/api/extract/url', { - method: 'POST', - body: JSON.stringify({ url }) - }); - - const summary = `Extracted content from: ${result.title || 'webpage'}`; - return { - content: [{ type: 'text', text: summary }], - structuredContent: { - success: true, - title: result.title || 'Untitled', - content: result.content || '', - chunk: result.chunk || '', - metadata: result.metadata || {} - } - }; - } -); - -mcpServer.registerTool( - 'rah_extract_youtube', - { - title: 'Extract YouTube transcript', - description: 'Extract transcript from a YouTube video. Returns title, channel, transcript, and metadata.', - inputSchema: extractYoutubeInputSchema, - outputSchema: extractYoutubeOutputSchema - }, - async ({ url }) => { - const result = await callRaHApi('/api/extract/youtube', { - method: 'POST', - body: JSON.stringify({ url }) - }); - - const summary = `Extracted transcript from: ${result.title || 'YouTube video'}`; - return { - content: [{ type: 'text', text: summary }], - structuredContent: { - success: true, - title: result.title || 'Untitled', - channel: result.channel || 'Unknown', - transcript: result.transcript || '', - metadata: result.metadata || {} - } - }; - } -); - -mcpServer.registerTool( - 'rah_extract_pdf', - { - title: 'Extract PDF content', - description: 'Extract content from a PDF file URL. Returns title, content, and metadata for creating nodes.', - inputSchema: extractPdfInputSchema, - outputSchema: extractPdfOutputSchema - }, - async ({ url }) => { - const result = await callRaHApi('/api/extract/pdf', { - method: 'POST', - body: JSON.stringify({ url }) - }); - - const summary = `Extracted content from: ${result.title || 'PDF document'}`; - return { - content: [{ type: 'text', text: summary }], - structuredContent: { - success: true, - title: result.title || 'Untitled PDF', - content: result.content || '', - chunk: result.chunk || '', - metadata: result.metadata || {} - } - }; - } -); - async function readRequestBody(req) { if (req.method !== 'POST') return undefined; try { diff --git a/apps/mcp-server/stdio-server.js b/apps/mcp-server/stdio-server.js index a6128cf..07555b1 100644 --- a/apps/mcp-server/stdio-server.js +++ b/apps/mcp-server/stdio-server.js @@ -202,45 +202,6 @@ const searchEmbeddingsOutputSchema = { ) }; -// rah_extract_url schemas -const extractUrlInputSchema = { - url: z.string().url().describe('URL of the webpage to extract content from') -}; - -const extractUrlOutputSchema = { - success: z.boolean(), - title: z.string(), - content: z.string(), - chunk: z.string(), - metadata: z.record(z.any()) -}; - -// rah_extract_youtube schemas -const extractYoutubeInputSchema = { - url: z.string().describe('YouTube video URL to extract transcript from') -}; - -const extractYoutubeOutputSchema = { - success: z.boolean(), - title: z.string(), - channel: z.string(), - transcript: z.string(), - metadata: z.record(z.any()) -}; - -// rah_extract_pdf schemas -const extractPdfInputSchema = { - url: z.string().url().describe('URL of the PDF file to extract content from') -}; - -const extractPdfOutputSchema = { - success: z.boolean(), - title: z.string(), - content: z.string(), - chunk: z.string(), - metadata: z.record(z.any()) -}; - const server = new McpServer(serverInfo, { instructions }); function logError(...args) { @@ -694,90 +655,6 @@ server.registerTool( } ); -server.registerTool( - 'rah_extract_url', - { - title: 'Extract URL content', - description: 'Extract content from a webpage URL. Returns title, content, and metadata for creating nodes.', - inputSchema: extractUrlInputSchema, - outputSchema: extractUrlOutputSchema - }, - async ({ url }) => { - const result = await callRaHApi('/api/extract/url', { - method: 'POST', - body: JSON.stringify({ url }) - }); - - const summary = `Extracted content from: ${result.title || 'webpage'}`; - return { - content: [{ type: 'text', text: summary }], - structuredContent: { - success: true, - title: result.title || 'Untitled', - content: result.content || '', - chunk: result.chunk || '', - metadata: result.metadata || {} - } - }; - } -); - -server.registerTool( - 'rah_extract_youtube', - { - title: 'Extract YouTube transcript', - description: 'Extract transcript from a YouTube video. Returns title, channel, transcript, and metadata.', - inputSchema: extractYoutubeInputSchema, - outputSchema: extractYoutubeOutputSchema - }, - async ({ url }) => { - const result = await callRaHApi('/api/extract/youtube', { - method: 'POST', - body: JSON.stringify({ url }) - }); - - const summary = `Extracted transcript from: ${result.title || 'YouTube video'}`; - return { - content: [{ type: 'text', text: summary }], - structuredContent: { - success: true, - title: result.title || 'Untitled', - channel: result.channel || 'Unknown', - transcript: result.transcript || '', - metadata: result.metadata || {} - } - }; - } -); - -server.registerTool( - 'rah_extract_pdf', - { - title: 'Extract PDF content', - description: 'Extract content from a PDF file URL. Returns title, content, and metadata for creating nodes.', - inputSchema: extractPdfInputSchema, - outputSchema: extractPdfOutputSchema - }, - async ({ url }) => { - const result = await callRaHApi('/api/extract/pdf', { - method: 'POST', - body: JSON.stringify({ url }) - }); - - const summary = `Extracted content from: ${result.title || 'PDF document'}`; - return { - content: [{ type: 'text', text: summary }], - structuredContent: { - success: true, - title: result.title || 'Untitled PDF', - content: result.content || '', - chunk: result.chunk || '', - metadata: result.metadata || {} - } - }; - } -); - async function main() { const transport = new StdioServerTransport(); await server.connect(transport);