
larsenweigle/langextract-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
FastMCP for Google's langextract library
概要
A FastMCP server for Google's langextract library. This server enables AI assistants like Claude Code to extract structured information from unstructured text using Large Language Models through a MCP interface. LangExtract is a Python library that uses LLMs to extract structured information from text documents while maintaining precise source grounding. This MCP server exposes langextract's capabilities through the Model Context Protocol. The server includes intelligent caching, persistent connections, and server-side credential management to provide optimal performance in long-running environments like Claude Code. - Claude Code installed and configured - Google Gemini API key (Get one here) - Python 3.10 or higher Install directly into Claude Code using the built-in MCP management: The server will automatically start and integrate with Claude Code. No additional configuration is required.
README
以下は原文 README の抜粋です。原文を見る。
LangExtract MCP Server
A FastMCP server for Google’s langextract library. This server enables AI assistants like Claude Code to extract structured information from unstructured text using Large Language Models through a MCP interface.
Overview
LangExtract is a Python library that uses LLMs to extract structured information from text documents while maintaining precise source grounding. This MCP server exposes langextract’s capabilities through the Model Context Protocol. The server includes intelligent caching, persistent connections, and server-side credential management to provide optimal performance in long-running environments like Claude Code.
Quick Setup for Claude Code
Prerequisites
- Claude Code installed and configured
- Google Gemini API key (Get one here)
- Python 3.10 or higher
Installation
Install directly into Claude Code using the built-in MCP management:
claude mcp add langextract-mcp -e LANGEXTRACT_API_KEY=your-gemini-api-key -- uv run --with fastmcp fastmcp run src/langextract_mcp/server.py
The server will automatically start and integrate with Claude Code. No additional configuration is required.
Verification
After installation, verify the integration entering in Claude Code:
/mcp
You should see output indicating the server is running and can enter the server to see its tool contents.
Available Tools
The server provides the following tools for text extraction workflows:
Core Extraction
extract_from_text- Extract structured information from provided textextract_from_url- Extract information from web contentsave_extraction_results- Save results to JSONL formatgenerate_visualization- Create interactive HTML visualizations
For more information, you can checkout out the resources available to the client under src/langextract_mcp/resources
Usage Examples
I am currently adding the abilty for MCP clients to pass file paths to unstructured text.
Basic Text Extraction
Ask Claude Code to extract information using natural language:
Extract medication information from this text: "Patient prescribed 500mg amoxicillin twice daily for infection"
Use these examples to guide the extraction:
- Text: "Take 250mg ibuprofen every 4 hours"
- Expected: medication=ibuprofen, dosage=250mg, frequency=every 4 hours
Advanced Configuration
For complex extractions, specify configuration parameters:
Extract character emotions from Shakespeare using:
- Model: gemini-2.5-pro for better literary analysis
- Multiple passes: 3 for comprehensive extraction
- Temperature: 0.2 for consistent results
URL Processing
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →