Logo van Dive MCP Host

Dive MCP Host

Organisatie
OpenAgentPlatform

A production-grade Python host for the Model Context Protocol — multi-LLM, multi-transport, spec-compliant.

UitgeverOpenAgentPlatform
Repositorydive-mcp-host
TaalPython
Forks
18
Sterren
48
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieMIT
Links
  • Koppel tools aan AI-workflows

    Dive MCP Host biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • 0 beschikbare tools

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Indicatoren van opensource-interesse

    48 sterren en 18 forks in de gekoppelde repository.

🌊 Dive MCP Host

A production-grade Python host for the Model Context Protocol — multi-LLM, multi-transport, spec-compliant.

Python 3.12+ License: MIT MCP Spec LangGraph

The Python brain behind the Dive desktop app — also runnable standalone as a service or library.


✨ Why Dive MCP Host?

The MCP ecosystem is growing fast, but most hosts are tightly coupled to a single LLM, a single transport, or a single front-end. Dive MCP Host is the opposite: a transport-agnostic, model-agnostic runtime that turns any collection of MCP servers into a single agent backend.

  • 🧠 Any LLM — OpenAI, Anthropic, Google, AWS Bedrock, Mistral, DeepSeek, Ollama, Azure OpenAI — anything LangChain speaks.
  • 🔌 Any MCP server — stdio, sse, streamable-http, websocket, plus a "spawn-and-connect" local-HTTP mode.
  • 🛰 Three ways to use it — embed the SDK, talk to the HTTP API, or drive it from the CLI.
  • 🧩 Spec-compliant capability negotiation — calls tools/list / prompts/list only when the server advertises them; gracefully tolerates Method not found.
  • 💬 MCP prompts as first-class — list, fetch, render, and refresh on notifications/prompts/list_changed.
  • 🔐 OAuth + elicitation built in — interactive flows surface to the host without bespoke glue per server.
  • 🗃 Persistent threads — SQLite or Postgres checkpointing via LangGraph; messages, OAuth tokens, and conversation state survive restarts.

🏗 Architecture at a Glance

The same DiveMcpHost core is reused by all three entry points. The HTTP layer is a thin FastAPI wrapper; the CLI and SDK are even thinner.

Lifecycle

Everything is an async context manager (ContextProtocol). Resources nest strictly so cleanup is deterministic:


🚀 Quick Start

Install

bash
# Recommended: uv (respects uv.lock)
uv sync --frozen

# Or with pip
pip install -e .

# With dev tools (pytest, ruff, …)
uv sync --extra dev --frozen

Requires Python 3.12+.

Run the HTTP service

bash
dive_httpd

Serves on 0.0.0.0:61990 by default. Configure via dive_httpd.json (DB, checkpointer, CORS).

Try the CLI

bash
dive_cli "Summarize today's news"
dive_cli -c CHAT_ID "and what about tech?"   # resume a thread

Embed in Python

python
from dive_mcp_host.host.host import DiveMcpHost
from dive_mcp_host.host.conf import HostConfig

config = HostConfig(...)  # see model_config.json / mcp_config.json samples

async with DiveMcpHost(config) as host:
    async with host.chat(chat_id="demo") as chat:
        async for event in chat.query("hello"):
            print(event)

⚙️ Configuration

Three JSON files drive the service. Samples are at the repo root.

json
{
  "mcpServers": {
    "fetch": {
      "transport": "stdio",
      "command": "uvx",
      "args": ["mcp-server-fetch@latest"]
    },
    "weather": {
      "transport": "streamable",
      "url": "https://example.com/mcp"
    }
  }
}

Supported transport values: stdio, sse, streamable, websocket. Add "command" together with "url" to spawn a local HTTP MCP server and connect to it.

json
{
  "activeProvider": "ollama",
  "configs": {
    "openai":     { "modelProvider": "openai",    "model": "gpt-4o-mini", "apiKey": "..." },
    "anthropic":  { "modelProvider": "anthropic", "model": "claude-sonnet-4-5" },
    "ollama":     { "modelProvider": "ollama",    "model": "qwen2.5:14b",
                    "configuration": { "baseURL": "http://localhost:11434" } }
  }
}
json
{
  "db":           { "uri": "sqlite:///db.sqlite", "async_uri": "sqlite+aiosqlite:///db.sqlite", "migrate": true },
  "checkpointer": { "uri": "sqlite:///db.sqlite" },
  "cors_origin":  "http://localhost:5173"
}

🧩 MCP Capability Support

Dive negotiates capabilities per the MCP spec: each server's initialize response is inspected, and only the advertised endpoints are queried. This protects you from the entire class of "host crashes because server doesn't implement X" bugs.

CapabilityBehavior
tools 🔧Listed at startup, exposed to the LLM, dispatched via call_tool.
prompts 💬Listed at startup, cached, refreshed on notifications/prompts/list_changed. Surfaced via McpServerInfo.prompts and the /api/tools response.
resources 📦Discovery wired up; expose as needed by your front-end.
OAuth 🔐Full authorization-code + dynamic-client-registration flow with persistent token store.
Elicitation 🗨Server-initiated prompts surface to the front-end via the elicitation manager.
Method not found ⚠️Treated as "server doesn't support that"; never breaks initialization.

Prompts HTTP API

http
GET  /api/tools/{server}/prompts          # list (?refresh=true bypasses cache)
POST /api/tools/{server}/prompts/get      # body: {"name": "...", "arguments": {...}}

Both endpoints return the repo-standard DataResult[T] envelope ({success, message, data}); data is the list of prompts or the rendered GetPromptResult (description + ordered PromptMessages) ready to append to a chat thread.


🔭 HTTP API Map

PrefixPurpose
/api/chatStreaming chat, message history
/api/v1/mcpRemote MCP-style endpoints (re-mount of /api/chat)
/api/toolsServer inventory, prompts, OAuth, elicitation, log stream
/api/configHot-reload MCP and model config
/api/skillsMarkdown-defined skills (with frontmatter)
/v1/openaiOpenAI-compatible chat completion endpoint
/model_verifyOne-shot credential check for an LLM provider

🧪 Development

bash
# Install dev deps
uv sync --extra dev --frozen

# (Optional) local Postgres for tests/dev
./scripts/run_pg.sh

# Run the full suite
pytest

# Single test
pytest tests/test_tools.py::test_mcp_server_info

# Integration tests only
pytest -m integration

# Lint & format (ruff is the only tool you need)
ruff check .
ruff format .

# DB migrations
alembic upgrade head
alembic revision --autogenerate -m "describe change"

Without activating the venv:

bash
uv run --extra dev --frozen pytest

🤝 Contributing

This repo is the Python backend of the Dive desktop app. PRs that change wire formats must stay backwards-compatible with shipped Dive builds — favor additive fields and new endpoints over breaking existing ones.

📜 License

MIT — see LICENSE.

Installatie

TypingMind
Vereisten:

Node.js 18+

{
  "mcpServers": {
    "openagentplatform-dive-mcp-host": {
      "command": "",
      "args": []
    }
  }
}

Gebruik Dive MCP Host MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra Dive MCP Host is verbonden, kun je deze dus met verschillende AI-modellen in TypingMind gebruiken, zonder de verbinding voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg Dive MCP Host toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus Gereed aangeeft.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van Dive MCP Host.
  4. Sla de serverlijst op.
  5. Vernieuw om te controleren of de connector nog steeds klaar is voor gebruik.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "openagentplatform-dive-mcp-host": {
      "command": "npx",
      "args": [
        "-y",
        "dive-mcp-host"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van Dive MCP Host in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van Dive MCP Host in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je Dive MCP Host gebruiken om me hiermee te helpen?
Dive MCP Host
Zeker. Ik heb het gelezen.
Dit vond ik met Dive MCP Host.

Veelgestelde vragen

Waarvoor wordt de MCP-server Dive MCP Host gebruikt?

Dive MCP Host is een MCP-server waarmee compatibele AI-clients verbinding kunnen maken met externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik Dive MCP Host MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je Dive MCP Host gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom Dive MCP Host MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als Dive MCP Host verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik Dive MCP Host MCP met TypingMind?

Dive MCP Host werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt Dive MCP Host MCP in TypingMind?

Dive MCP Host biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om Dive MCP Host MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als Dive MCP Host authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇