Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-Upstage-Serverextract invoice details from this PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-Upstage-Server
Node.js/TypeScript implementation of the MCP server for Upstage AI services.
Features
Document Parsing: Extract structure and content from various document types (PDF, images, Office files)
Information Extraction: Extract structured information using custom or auto-generated schemas
Schema Generation: Automatically generate extraction schemas from document analysis
Document Classification: Classify documents into predefined categories (invoice, receipt, contract, etc.)
Built with TypeScript for type safety
Dual transport support: stdio (default) and HTTP Streamable
Async/await pattern throughout
Comprehensive error handling and retry logic
Progress reporting support
Installation
Prerequisites
Node.js 18.0.0 or higher
Upstage API key from Upstage Console
Install from npm
Install from source
Usage
Running the server
Integration with Claude Desktop
Option 1: stdio transport (default)
Option 2: HTTP Streamable transport
Transport Options
stdio Transport (Default)
Pros: Simple setup, direct process communication
Cons: Single client connection only
Usage: Default mode, no additional configuration needed
HTTP Streamable Transport
Pros: Multiple client support, network accessible, RESTful API
Cons: Requires port management, network configuration
Endpoints:
POST /mcp- Main MCP communication endpointGET /mcp- Server-Sent Events streamGET /health- Health check endpoint
Available Tools
parse_document
Parse a document using Upstage AI's document digitization API.
Parameters:
file_path(required): Path to the document fileoutput_formats(optional): Array of output formats (e.g., ['html', 'text', 'markdown'])
Supported formats: PDF, JPEG, PNG, TIFF, BMP, GIF, WEBP
extract_information
Extract structured information from documents using Upstage Universal Information Extraction.
Parameters:
file_path(required): Path to the document fileschema_path(optional): Path to JSON schema fileschema_json(optional): JSON schema as stringauto_generate_schema(optional, default: true): Auto-generate schema if none provided
Supported formats: JPEG, PNG, BMP, PDF, TIFF, HEIC, DOCX, PPTX, XLSX
generate_schema
Generate an extraction schema for a document using Upstage AI's schema generation API.
Parameters:
file_path(required): Path to the document file to analyze
Supported formats: JPEG, PNG, BMP, PDF, TIFF, HEIC, DOCX, PPTX, XLSX
This tool analyzes a document and automatically generates a JSON schema that defines the structure and fields that can be extracted from similar documents. The generated schema can then be used with the extract_information tool when auto_generate_schema is set to false.
Use cases:
Create reusable schemas for multiple similar documents
Have more control over extraction fields
Ensure consistent field naming across extractions
The tool returns both a readable schema object and a schema_json string that can be directly copied and used with the extract_information tool.
classify_document
Classify a document into predefined categories using Upstage AI's document classification API.
Parameters:
file_path(required): Path to the document file to classifyschema_path(optional): Path to JSON file containing custom classification schemaschema_json(optional): JSON string containing custom classification schema
Supported formats: JPEG, PNG, BMP, PDF, TIFF, HEIC, DOCX, PPTX, XLSX
This tool analyzes a document and classifies it into categories. By default, it uses a comprehensive set of document types, but you can provide custom classification categories.
Default categories:
invoice, receipt, contract, cv, bank_statement, tax_document, insurance, business_card, letter, form, certificate, report, others
Use cases:
Automatically sort and organize documents by type
Filter documents for specific processing workflows
Build document management systems with automatic categorization
Schema Guide for Information Extraction
When auto_generate_schema is false, you need to provide a custom schema. Here's how to format it correctly:
π Basic Schema Structure
The schema must follow this exact structure:
β Common Mistakes
Wrong: Missing nested structure
Wrong: Incorrect response_format
Wrong: Missing properties wrapper
β Correct Examples
Simple schema:
Complex schema with arrays and objects:
π οΈ Schema Creation Helper
You can create schemas programmatically:
π‘ Data Types
"string": Text data (names, addresses, etc.)"number": Numeric data (amounts, quantities, etc.)"boolean": True/false values"array": Lists of items"object": Nested structures"null": Null values
π Best Practices
Always include descriptions: They help the AI understand what to extract
Use specific field names:
invoice_dateinstead ofdateNest related fields: Group related information in objects
Validate your JSON: Use a JSON validator before using the schema
Test with simple schemas first: Start with basic fields before adding complexity
Classification Schema Guide
The classify_document tool uses a different schema format optimized for classification tasks. Here's how to create custom classification schemas:
π Simple Classification Categories
For custom categories, just provide an array of category objects:
The tool automatically wraps this in the proper schema structure for the API.
β Correct Classification Examples
Medical document classifier:
Business document classifier:
β Common Classification Mistakes
Wrong: Missing description field
Wrong: Missing const field
Wrong: Using different field names
π‘ Classification Best Practices
Always include "others" category: Provides fallback for unexpected document types
Use descriptive const values: Clear category names like "medical_prescription" vs "doc1"
Add meaningful descriptions: Help the AI understand what each category represents
Keep categories mutually exclusive: Avoid overlapping categories that could confuse classification
Limit category count: Too many categories can reduce accuracy (recommended: 3-10 categories)
Use consistent naming: Stick to snake_case or kebab-case throughout
π οΈ Classification Categories Helper
Development
Project Structure
Output Files
Results are saved to:
Document parsing:
~/.mcp-upstage/outputs/document_parsing/Information extraction:
~/.mcp-upstage/outputs/information_extraction/Generated schemas:
~/.mcp-upstage/outputs/information_extraction/schemas/Document classification:
~/.mcp-upstage/outputs/document_classification/
License
MIT