Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

morphik-mcp

MCP.Pizza Chef: morphik-org

Morphik MCP is a Model Context Protocol server that integrates AI assistants like Claude with the Morphik multi-modal database. It supports document ingestion, retrieval, querying with LLM completions, document management, and file system navigation. It connects to either a local Morphik server or the Morphik cloud platform, enabling seamless AI-driven database interactions and file operations within specified directories.

Use This MCP server To

Ingest text and files into Morphik database via AI assistants Retrieve relevant documents from Morphik based on natural language queries Query Morphik documents with LLM-powered completions for detailed insights Manage documents by listing, retrieving, or deleting through AI commands Navigate file systems and ingest files from specified directories into Morphik

README

Morphik MCP

A Model Context Protocol (MCP) server implementation for Morphik multi-modal database.

Overview

This MCP server allows Claude and other MCP-compatible AI assistants to interact with the Morphik database system, enabling:

  • Document ingestion (text and files)
  • Document retrieval (by relevance to queries)
  • Document querying with LLM-powered completions
  • Document management (listing, getting, deleting)
  • File system navigation and file ingestion from paths

Prerequisites

You need access to either:

  • A local Morphik server running on localhost:8000, or
  • The Morphik cloud platform

Installation & Usage

Option 1: Run directly with npx (recommended)

# Connect to local Morphik server
npx morphik-mcp

# Connect to Morphik cloud platform (replace with your actual URI)
npx morphik-mcp --uri=https://api.morphik.ai

# Specify allowed directories for file operations (comma-separated)
npx morphik-mcp --allowed-dir=~/Documents,~/Downloads

Option 2: Global installation

npm install -g morphik-mcp

# Connect to local Morphik server
morphik-mcp

# Connect to Morphik cloud platform
morphik-mcp --uri=https://api.morphik.ai

# Specify allowed directories for file operations
morphik-mcp --allowed-dir=~/Documents,~/Downloads

Option 3: Local development

# Clone the repository
git clone https://github.com/morphik-org/morphik-npm-mcp.git
cd morphik-npm-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Start the server (local Morphik)
npm start

# Start the server with file operations enabled
node build/index.js --allowed-dir=~/Documents,~/Downloads

The server runs on standard input/output streams and can be used with MCP clients like Claude.

Usage with Claude Desktop

Add this to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "morphik-local": {
      "command": "npx",
      "args": ["-y", "morphik-mcp"]
    },
    "morphik-cloud": {
      "command": "npx",
      "args": ["-y", "morphik-mcp", "--uri=https://api.morphik.ai"]
    },
    "morphik-with-files": {
      "command": "npx",
      "args": ["-y", "morphik-mcp", "--allowed-dir=~/Documents,~/Downloads"]
    }
  }
}

MCP Tools

The server provides the following tools:

1. Document Ingestion

  • ingest-text: Ingest a text document into Morphik

    • Parameters: content, filename (optional), metadata (optional), apiKey
  • ingest-file-from-path: Ingest a file from the server's filesystem into Morphik

    • Parameters: path, metadata (optional), rules (optional), folderName (optional), endUserId (optional), useColpali (optional)
  • ingest-files-from-paths: Batch ingest multiple files from the server's filesystem

    • Parameters: paths, metadata (optional), rules (optional), folderName (optional), endUserId (optional), useColpali (optional)

2. Document Retrieval

  • retrieve-chunks: Retrieve relevant chunks from Morphik based on a query

    • Parameters: query, filters (optional), k (optional), minScore (optional), apiKey
  • retrieve-docs: Retrieve relevant documents from Morphik based on a query

    • Parameters: query, filters (optional), k (optional), minScore (optional), apiKey

3. Document Querying

  • query: Generate a completion using relevant chunks as context
    • Parameters: query, filters (optional), k (optional), maxTokens (optional), temperature (optional), apiKey

4. Document Management

  • list-documents: List documents in Morphik

    • Parameters: skip (optional), limit (optional), filters (optional), apiKey
  • get-document: Get a specific document from Morphik by ID

    • Parameters: documentId, apiKey
  • delete-document: Delete a document from Morphik by ID

    • Parameters: documentId, apiKey

5. File System Navigation

  • list-allowed-directories: List directories that the server is allowed to access

    • Parameters: none
  • list-directory: List files and subdirectories in a specific directory

    • Parameters: path
  • search-files: Search for files matching a pattern in a directory and its subdirectories

    • Parameters: path, pattern, excludePatterns (optional)
  • get-file-info: Get detailed information about a file or directory

    • Parameters: path

File Operations Security

For security reasons, file operations are restricted to directories explicitly allowed when starting the server using the --allowed-dir parameter. If no directories are specified, only the user's home directory will be accessible.

The server validates all file paths to ensure they're within allowed directories, preventing access to sensitive system files. Symlinks are also checked to ensure they don't point outside allowed directories.

Development

Build the project:

npm run build

Run tests:

npm test

Run manual tests:

npm run test:manual

License

ISC

morphik-mcp FAQ

How do I connect morphik-mcp to a local Morphik server?
Run 'npx morphik-mcp' to connect to a local Morphik server on localhost:8000 by default.
Can morphik-mcp connect to the Morphik cloud platform?
Yes, use the '--uri' flag with your Morphik cloud API endpoint to connect.
How do I restrict file operations to certain directories?
Use the '--allowed-dir' option with comma-separated paths to limit file system access.
What AI assistants are compatible with morphik-mcp?
It supports Claude and any MCP-compatible AI assistants for seamless integration.
Is it necessary to run a local Morphik server to use morphik-mcp?
No, you can connect to the Morphik cloud platform instead.
What document operations does morphik-mcp support?
It supports document ingestion, retrieval, querying, listing, getting, and deleting.
How does morphik-mcp handle document querying?
It uses LLM-powered completions to provide detailed query responses on Morphik documents.
Can morphik-mcp ingest files from the file system?
Yes, it can navigate and ingest files from allowed directories specified at startup.