Cover image
Try Now
2025-03-31

Ein MCP -Server für die Interaktion mit Malloy -Datenmodellen über den Malloy -Verlag

3 years

Works with Finder

1

Github Watches

0

Github Forks

2

Github Stars

Malloy MCP Server

An MCP server implementation for executing Malloy queries and managing Malloy resources.

Features

  • Execute Malloy queries via MCP
  • Access Malloy project, package, and model metadata
  • Robust error handling with detailed context
  • Comprehensive test coverage
  • Type-safe implementation

Installation

# Install using uv (recommended)
uv pip install malloy-mcp-server

# Or using pip
pip install malloy-mcp-server

Usage

Starting the Server

from malloy_mcp_server import mcp

# Run the server
if __name__ == "__main__":
    mcp.serve()

Configuration

The server can be configured using environment variables:

Variable Description Default
MALLOY_PUBLISHER_ROOT_URL URL of the Malloy Publisher API http://localhost:4000

Example:

# Set the publisher URL
export MALLOY_PUBLISHER_ROOT_URL="http://malloy-publisher:4000"

# Run with custom configuration
python -m malloy_mcp_server

Executing Queries

The server provides an MCP tool for executing Malloy queries:

from malloy_mcp_server import ExecuteMalloyQueryTool

# Example query execution
result = await ExecuteMalloyQueryTool(
    query="select * from users",
    model_path="my_package/users"
)

Accessing Resources

The server provides the following resource endpoints:

  • malloy://project/home/metadata - Project metadata
  • malloy://project/home/package/{package_name} - Package metadata
  • malloy://project/home/model/{model_path} - Model metadata

Development

Setup

  1. Clone the repository:
git clone https://github.com/namabile/malloy-mcp-server.git
cd malloy-mcp-server
  1. Install dependencies:
uv pip install -e ".[dev]"

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=malloy_mcp_server

Code Quality

The project uses:

  • black for code formatting
  • mypy for type checking
  • ruff for linting

Run quality checks:

black .
mypy .
ruff check .

Error Handling

The server provides detailed error handling with context:

from malloy_mcp_server.errors import QueryExecutionError

try:
    result = await ExecuteMalloyQueryTool(...)
except QueryExecutionError as e:
    print(f"Error: {e.message}")
    print("Context:", e.context)

Architecture

The server is built on:

  • FastMCP for the MCP server implementation
  • Malloy Publisher Client for Malloy interactions
  • Pydantic for data validation

Key components:

  • server.py - Core server implementation
  • tools/query_executor.py - Query execution tool
  • errors.py - Error handling utilities

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

License

MIT License - see LICENSE file for details

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • jae-jae
  • MCP -Server für den Fetch -Webseiteninhalt mit dem Headless -Browser von Dramatikern.

  • ravitemer
  • Ein leistungsstarkes Neovim -Plugin für die Verwaltung von MCP -Servern (Modellkontextprotokoll)

  • patruff
  • Brücke zwischen Ollama und MCP -Servern und ermöglicht es lokalen LLMs, Modellkontextprotokoll -Tools zu verwenden

  • HiveNexus
  • Ein KI-Chat-Bot für kleine und mittelgroße Teams, die Modelle wie Deepseek, Open AI, Claude und Gemini unterstützt. 专为中小团队设计的 ai 聊天应用 , 支持 Deepseek 、 Open ai 、 claude 、 Gemini 等模型。

  • pontusab
  • Die Cursor & Windsurf -Community finden Regeln und MCPs

  • JackKuo666
  • 🔍 Ermöglichen Sie AI -Assistenten, über eine einfache MCP -Schnittstelle auf PYPI -Paketinformationen zu suchen und auf Paketinformationen zuzugreifen.

  • av
  • Führen Sie mühelos LLM -Backends, APIs, Frontends und Dienste mit einem Befehl aus.

    Reviews

    2 (1)
    Avatar
    user_0tE2BBKd
    2025-04-16

    As a dedicated user of malloy-mcp-server, I highly recommend this exceptional product by namabile. Its robust performance and seamless integration into my workflow have significantly improved my productivity. The clear documentation and active community support make it easy for both beginners and advanced users. Be sure to check it out on GitHub!