Skip to main content
Glama

kb-mcp-server

by Geeksfino
text.py984 B
""" Text processing tools for the txtai MCP server. """ from typing import List, Dict, Any, Optional from mcp.server.fastmcp import FastMCP from ..core import TxtAIContext def register_text_tools(mcp: FastMCP) -> None: """Register text processing tools with the MCP server.""" @mcp.tool() def extract_text(content: str, format: Optional[str] = None) -> str: """ Extract text from various content formats. Args: content: Content to extract text from format: Optional format hint (e.g., 'html', 'pdf') Returns: Extracted text """ ctx: TxtAIContext = mcp.request_context.lifespan_context["txtai_context"] if not ctx.pipelines or "textractor" not in ctx.pipelines: raise RuntimeError("Textractor pipeline not initialized") # Extract text extracted = ctx.pipelines["textractor"](content) return extracted

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/Geeksfino/kb-mcp-server'

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