Λογότυπο Dolphin MCP

Dolphin MCP

Οργανισμός
QuixiAI

A flexible Python library and CLI tool for interacting with Model Context Protocol (MCP) servers using any LLM model.

ΕκδότηςQuixiAI
Αποθετήριοdolphin-mcp
ΓλώσσαPython
Forks
58
Αστέρια
533
Διαθέσιμα εργαλεία
0
Τύπος μεταφοράςstdio
Κατηγορίες
Σύνδεσμοι
  • Συνδέστε εργαλεία σε ροές εργασίας AI

    Το Dolphin MCP παρέχει δυνατότητες MCP που μπορούν να χρησιμοποιηθούν από συμβατές εφαρμογές-πελάτες AI και πράκτορες AI.

  • 0 διαθέσιμα εργαλεία

    Περιηγηθείτε παρακάτω στις ενέργειες που μπορούν να κληθούν, μαζί με τα ονόματα και τις περιγραφές τους, όταν παρέχονται από τον διακομιστή.

  • Ρυθμίσεις έτοιμες για αντιγραφή

    Χρησιμοποιήστε τα αποσπάσματα εγκατάστασης για να ρυθμίσετε αυτόν τον διακομιστή στην εφαρμογή-πελάτη MCP που προτιμάτε.

  • Δείκτες ενδιαφέροντος για τον ανοιχτό κώδικα

    533 αστέρια και 58 διακλαδώσεις στο συνδεδεμένο αποθετήριο.

Dolphin MCP

A flexible Python library and CLI tool for interacting with Model Context Protocol (MCP) servers using any LLM model.

image

Overview

Dolphin MCP is both a Python library and a command-line tool that allows you to query and interact with MCP servers through natural language. It connects to any number of configured MCP servers, makes their tools available to language models (OpenAI, Anthropic, Ollama, LMStudio), and provides a conversational interface for accessing and manipulating data from these servers.

The project demonstrates how to:

  • Connect to multiple MCP servers simultaneously
  • List and call tools provided by these servers
  • Use function calling capabilities to interact with external data sources
  • Process and present results in a user-friendly way
  • Create a reusable Python library with a clean API
  • Build a command-line interface on top of the library

Features

  • Multiple Provider Support: Works with OpenAI, Anthropic, Ollama, and LMStudio models
  • Modular Architecture: Clean separation of concerns with provider-specific modules
  • Dual Interface: Use as a Python library or command-line tool
  • MCP Server Integration: Connect to any number of MCP servers simultaneously
  • Tool Discovery: Automatically discover and use tools provided by MCP servers
  • Flexible Configuration: Configure models and servers through JSON configuration
  • Environment Variable Support: Securely store API keys in environment variables
  • Comprehensive Documentation: Detailed usage examples and API documentation
  • Installable Package: Easy installation via pip with dolphin-mcp-cli command

Prerequisites

Before installing Dolphin MCP, ensure you have the following prerequisites installed:

  1. Python 3.10+
  2. SQLite - A lightweight database used by the demo
  3. uv/uvx - A fast Python package installer and resolver

Setting up Prerequisites

Windows

  1. Python 3.10+:

    • Download and install from python.org
    • Ensure you check "Add Python to PATH" during installation
  2. SQLite:

    • Download the precompiled binaries from SQLite website
    • Choose the "Precompiled Binaries for Windows" section and download the sqlite-tools zip file
    • Extract the files to a folder (e.g., C:\sqlite)
    • Add this folder to your PATH:
      • Open Control Panel > System > Advanced System Settings > Environment Variables
      • Edit the PATH variable and add the path to your SQLite folder
      • Verify installation by opening Command Prompt and typing sqlite3 --version
  3. uv/uvx:

    • Open PowerShell as Administrator and run:
      powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    • Restart your terminal and verify installation with uv --version

macOS

  1. Python 3.10+:

    • Install using Homebrew:
      brew install python
  2. SQLite:

    • SQLite comes pre-installed on macOS, but you can update it using Homebrew:
      brew install sqlite
    • Verify installation with sqlite3 --version
  3. uv/uvx:

    • Install using Homebrew:
      brew install uv
    • Or use the official installer:
      curl -LsSf https://astral.sh/uv/install.sh | sh
    • Verify installation with uv --version

Linux (Ubuntu/Debian)

  1. Python 3.10+:

    sudo apt update
    sudo apt install python3 python3-pip
  2. SQLite:

    sudo apt update
    sudo apt install sqlite3
    • Verify installation with sqlite3 --version
  3. uv/uvx:

    curl -LsSf https://astral.sh/uv/install.sh | sh
    • Verify installation with uv --version

Installation

Option 1: Install from PyPI (Recommended)

bash
pip install dolphin-mcp

This will install both the library and the dolphin-mcp-cli command-line tool.

Option 2: Install from Source

  1. Clone this repository:

    bash
    git clone https://github.com/QuixiAI/dolphin-mcp.git
    cd dolphin-mcp
  2. Install the package in development mode:

    bash
    pip install -e .
  3. Set up your environment variables by copying the example file and adding your OpenAI API key:

    bash
    cp .env.example .env

    Then edit the .env file to add your OpenAI API key.

  4. (Optional) Set up the demo dolphin database:

    bash
    python setup_db.py

    This creates a sample SQLite database with dolphin information that you can use to test the system.

Configuration

The project uses two main configuration files:

  1. .env - Contains OpenAI API configuration:

    OPENAI_API_KEY=your_openai_api_key_here
    OPENAI_MODEL=gpt-4o
    # OPENAI_BASE_URL=https://api.openai.com/v1  # Uncomment and modify if using a custom base url
  2. mcp_config.json - Defines MCP servers to connect to:

    json
    {
      "mcpServers": {
        "server1": {
          "command": "command-to-start-server",
          "args": ["arg1", "arg2"],
          "env": {
            "ENV_VAR1": "value1",
            "ENV_VAR2": "value2"
          }
        },
        "server2": {
          "command": "another-server-command",
          "args": ["--option", "value"]
        }
      }
    }

    You can add as many MCP servers as you need, and the client will connect to all of them and make their tools available.

Usage

Using the CLI Command

Run the CLI command with your query as an argument:

bash
dolphin-mcp-cli "Your query here"

Command-line Options

Usage: dolphin-mcp-cli [--model <name>] [--quiet] [--interactive | -i] [--config <file>] [--mcp-config <file>] [--log-messages <file>] [--debug] ['your question']

Options:
  --model <name>         Specify the model to use (e.g., gpt-4o, dolphin, qwen2.5-7b)
  --quiet                Suppress intermediate output (except errors)
  --interactive, -i      Enable interactive chat mode. If selected, 'your question' argument is optional for the first turn.
  --config <file>        Specify a custom config file for LLM providers (default: config.yml)
  --mcp-config <file>    Specify a custom config file for MCP servers (default: examples/sqlite-mcp.json)
  --log-messages <file>  Log all LLM interactions to a JSONL file
  --debug                Enable debug logging (Note: `cli.py` sets DEBUG level by default currently)
  --help, -h             Show this help message

Interactive Chat Mode

To start dolphin-mcp-cli in interactive mode, use the --interactive or -i flag:

bash
dolphin-mcp-cli --interactive
# or
dolphin-mcp-cli -i

You can also provide an initial question:

bash
dolphin-mcp-cli -i "What dolphin species are endangered?"

In interactive mode, you can have a continuous conversation with the configured model. The chat will maintain context from previous turns. Type exit or quit to end the session.

Using the Library Programmatically

You can also use Dolphin MCP as a library in your Python code:

python
import asyncio
from dolphin_mcp import run_interaction

async def main():
    result = await run_interaction(
        user_query="What dolphin species are endangered?",
        model_name="gpt-4o",  # Optional, will use default from config if not specified
        config_path="mcp_config.json",  # Optional, defaults to mcp_config.json
        quiet_mode=False  # Optional, defaults to False
    )
    print(result)

# Run the async function
asyncio.run(main())

Using the Original Script (Legacy)

You can still run the original script directly:

bash
python dolphin_mcp.py "Your query here"

The tool will:

  1. Connect to all configured MCP servers
  2. List available tools from each server
  3. Call the language model API with your query and the available tools
  4. Execute any tool calls requested by the model
  5. Return the results in a conversational format

Example Queries

Examples will depend on the MCP servers you have configured. With the demo dolphin database:

bash
dolphin-mcp-cli --mcp-config examples/sqlite-mcp.json --model gpt-4o "What dolphin species are endangered?"

Or with your own custom MCP servers:

bash
dolphin-mcp-cli "Query relevant to your configured servers"

You can also specify a model to use:

bash
dolphin-mcp-cli --model gpt-4o "What are the evolutionary relationships between dolphin species?"

To use the LMStudio provider:

bash
dolphin-mcp-cli --model qwen2.5-7b "What are the evolutionary relationships between dolphin species?"

For quieter output (suppressing intermediate results):

bash
dolphin-mcp-cli --quiet "List all dolphin species in the Atlantic Ocean"

For more detailed examples and use cases, please refer to the examples README.

Demo Database

If you run setup_db.py, it will create a sample SQLite database with information about dolphin species. This is provided as a demonstration of how the system works with a simple MCP server. The database includes:

  • Information about various dolphin species
  • Evolutionary relationships between species
  • Conservation status and physical characteristics

This is just one example of what you can do with the Dolphin MCP client. You can connect it to any MCP server that provides tools for accessing different types of data or services.

Requirements

  • Python 3.10+
  • OpenAI API key (or other supported provider API keys)

Core Dependencies

  • openai
  • mcp[cli]
  • python-dotenv
  • anthropic
  • ollama
  • lmstudio
  • jsonschema

Development Dependencies

  • pytest
  • pytest-asyncio
  • pytest-mock
  • uv

Demo Dependencies

  • mcp-server-sqlite

All dependencies are automatically installed when you install the package using pip.

How It Works

Package Structure

The package is organized into several modules:

  • dolphin_mcp/ - Main package directory
    • __init__.py - Package initialization and exports
    • client.py - Core MCPClient implementation and run_interaction function
    • cli.py - Command-line interface
    • utils.py - Utility functions for configuration and argument parsing
    • providers/ - Provider-specific implementations
      • openai.py - OpenAI API integration
      • anthropic.py - Anthropic API integration
      • ollama.py - Ollama API integration
      • lmstudio.py - LMStudio SDK integration

Execution Flow

  1. The CLI parses command-line arguments and calls the library's run_interaction function.
  2. The library loads configuration from mcp_config.json and connects to each configured MCP server.
  3. It retrieves the list of available tools from each server and formats them for the language model's API.
  4. The user's query is sent to the selected language model (OpenAI, Anthropic, Ollama, or LMStudio) along with the available tools.
  5. If the model decides to call a tool, the library routes the call to the appropriate server and returns the result.
  6. This process continues until the model has all the information it needs to provide a final response.

This modular architecture allows for great flexibility - you can add any MCP server that provides tools for accessing different data sources or services, and the client will automatically make those tools available to the language model. The provider-specific modules also make it easy to add support for additional language model providers in the future.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

[Add your license information here]

Εγκατάσταση

TypingMind
{
  "mcpServers": {
    "dolphin-mcp": {
      "command": "dolphin-mcp-cli",
      "args": [
        "{{config.QUERY}}"
      ],
      "env": {
        "QUERY": "<QUERY>"
      }
    }
  }
}

Χρησιμοποιήστε το MCP Dolphin MCP με πολλά μοντέλα AI

Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας. Έτσι, μόλις συνδεθεί το Dolphin MCP, μπορείτε να το χρησιμοποιείτε με διαφορετικά μοντέλα AI στο TypingMind, αντί να το ρυθμίζετε ξεχωριστά για κάθε μοντέλο. Αυτή η ενσωμάτωση MCP εκτελείται τοπικά στη συσκευή σας μέσω του συνδέσμου MCP του TypingMind.

Οδηγός ρύθμισης για τη χρήση του τοπικού συνδέσμου

Επιλέξτε αυτή τη μέθοδο όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές ή ιδιωτικούς πόρους στον υπολογιστή σας.

1

Ανοίξτε τις ρυθμίσεις MCP

Στο TypingMind, μεταβείτε στις «Ρυθμίσεις», έπειτα στις «Σύνθετες ρυθμίσεις» και στο «Model Context Protocol» και επιλέξτε «Ρύθμιση συνδέσμου».

  1. Ανοίξτε το TypingMind στο πρόγραμμα περιήγησής σας.
  2. Κάντε κλικ στο εικονίδιο «Ρυθμίσεις».
  3. Μεταβείτε στις «Σύνθετες ρυθμίσεις».
  4. Ανοίξτε την ενότητα Model Context Protocol.
  5. Κάντε κλικ στην επιλογή «Ρύθμιση συνδέσμου» και επιλέξτε «Αυτή η συσκευή».
Οθόνη ρύθμισης συνδέσμου MCP του TypingMind με επιλεγμένη την επιλογή «Αυτή η συσκευή»
2

Εκτελέστε την εντολή του συνδέσμου

Επιλέξτε «Αυτή η συσκευή», αντιγράψτε την εντολή από το TypingMind και εκτελέστε την στο Τερματικό. Διατηρήστε τη διεργασία σε λειτουργία όσο χρησιμοποιείτε το MCP.

  1. Αντιγράψτε την εντολή ρύθμισης που εμφανίζεται στο TypingMind.
  2. Ανοίξτε το Τερματικό στο macOS ή το Windows Terminal στα Windows.
  3. Επικολλήστε και εκτελέστε την εντολή.
  4. Εγκρίνετε την εγκατάσταση του πακέτου, αν το Τερματικό σάς ζητήσει επιβεβαίωση για να συνεχίσει.
  5. Διατηρήστε ανοιχτό το παράθυρο του Τερματικού και τη διεργασία σε λειτουργία όσο χρησιμοποιείτε εργαλεία MCP.
3

Προσθέστε το Dolphin MCP ως διακομιστή

Όταν η κατάσταση του συνδέσμου είναι «Έτοιμος», κάντε κλικ στο «Αλλαγή servers» και επικολλήστε τις ρυθμίσεις του διακομιστή MCP.

  1. Περιμένετε μέχρι η κατάσταση του συνδέσμου να εμφανιστεί ως «Έτοιμος».
  2. Κάντε κλικ στο «Αλλαγή servers».
  3. Επικολλήστε τις ρυθμίσεις του διακομιστή MCP Dolphin MCP.
  4. Αποθηκεύστε τη λίστα διακομιστών.
  5. Κάντε ανανέωση αν θέλετε να επιβεβαιώσετε ότι ο σύνδεσμος παραμένει έτοιμος για χρήση.
Ρυθμίσεις MCP του TypingMind με ενεργό διακομιστή και το κουμπί «Αλλαγή servers»
{
  "mcpServers": {
    "dolphin-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Χρησιμοποιήστε τη σύνδεση με διαφορετικά μοντέλα

Αποθηκεύστε τη λίστα διακομιστών, ανοίξτε τα «Πρόσθετα», ενεργοποιήστε τα εργαλεία MCP του Dolphin MCP και έπειτα επιλέξτε οποιοδήποτε υποστηριζόμενο μοντέλο AI στο TypingMind. Χρησιμοποιήστε τα εργαλεία στη συνομιλία ή αναθέστε τα σε έναν πράκτορα AI.

  1. Ανοίξτε τη σελίδα «Πρόσθετα» στο TypingMind.
  2. Ενεργοποιήστε τα εργαλεία MCP του Dolphin MCP.
  3. Ξεκινήστε μια συνομιλία και επιλέξτε το μοντέλο AI που θέλετε να χρησιμοποιήσετε.
  4. Χρησιμοποιήστε τα εργαλεία MCP στη συνομιλία ή αντιστοιχίστε τα σε έναν πράκτορα AI.
  5. Μεταβείτε σε άλλο μοντέλο AI όποτε χρειάζεται, χωρίς να συνδέσετε ξανά το MCP.
Συνομιλία στο TypingMind με ενεργοποιημένα εργαλεία MCP και επιλεγμένο μοντέλο AI
Θα με βοηθήσετε σε αυτό μέσω Dolphin MCP;
Dolphin MCP
Βεβαίως. Το διάβασα.
Δείτε τι βρήκα μέσω του Dolphin MCP.

Συχνές ερωτήσεις

Σε τι χρησιμεύει ο διακομιστής MCP Dolphin MCP;

Το Dolphin MCP είναι ένας διακομιστής MCP που επιτρέπει σε συμβατές εφαρμογές AI να συνδέονται με εξωτερικά εργαλεία και πληροφορίες πλαισίου. Στο TypingMind, μπορείτε να προσθέσετε αυτόν τον διακομιστή MCP μία φορά και να κάνετε τα εργαλεία του διαθέσιμα στον χώρο εργασίας AI σας.

Μπορώ να χρησιμοποιήσω το Dolphin MCP MCP με πολλά μοντέλα AI στο TypingMind;

Ναι. Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας, ώστε να μπορείτε να χρησιμοποιείτε το Dolphin MCP με διαφορετικά μοντέλα AI, όπως τα Claude, ChatGPT, Gemini ή άλλα μοντέλα που έχετε ρυθμίσει στο TypingMind, χωρίς να ρυθμίζετε τον διακομιστή MCP ξεχωριστά για κάθε μοντέλο.

Γιατί να χρησιμοποιήσετε τον σύνδεσμο MCP Dolphin MCP με το TypingMind;

Το TypingMind είναι ένα από τα καλύτερα περιβάλλοντα συνομιλίας με μεγάλα γλωσσικά μοντέλα, καθώς συγκεντρώνει πολλά μοντέλα AI, προτροπές, πρόσθετα, πράκτορες AI, κλειδιά API και εργαλεία MCP σε έναν χώρο εργασίας. Συνδέοντας το Dolphin MCP, μπορείτε να χρησιμοποιείτε τα εργαλεία MCP του με τα μοντέλα που προτιμάτε, διατηρώντας οργανωμένη τη ροή εργασίας των συνομιλιών σας στο TypingMind.

Πώς συνδέω το Dolphin MCP MCP στο TypingMind;

Το Dolphin MCP λειτουργεί μέσω του τοπικού συνδέσμου MCP του TypingMind. Αυτή είναι η καλύτερη επιλογή όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές υπολογιστή, εργαλεία γραμμής εντολών ή ιδιωτικούς πόρους στον υπολογιστή σας.

Ποια εργαλεία παρέχει το Dolphin MCP MCP στο TypingMind;

Το Dolphin MCP διαθέτει δυνατότητες MCP που μπορείτε να ενεργοποιήσετε από τη σελίδα Πρόσθετα του TypingMind και να χρησιμοποιήσετε σε συνομιλίες ή να αναθέσετε σε πράκτορες AI.

Χρειάζεται να κοινοποιήσω τα κλειδιά API μου στο TypingMind για να χρησιμοποιήσω το Dolphin MCP MCP;

Όχι. Το TypingMind δίνει προτεραιότητα στην τοπική λειτουργία και σας επιτρέπει να διατηρείτε τον έλεγχο των παρόχων μοντέλων, των κλειδιών API, των προτροπών και των ρυθμίσεων MCP σας. Αν το Dolphin MCP απαιτεί έλεγχο ταυτότητας, προσθέστε τις απαιτούμενες κεφαλίδες, τις ρυθμίσεις OAuth ή τις τοπικές ρυθμίσεις για τον συγκεκριμένο διακομιστή MCP κατά τη δημιουργία της σύνδεσης.

Σχετικοί διακομιστές MCP

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇