Skip to main content
Glama
fastmcp-me

Rasdaman MCP Server

by fastmcp-me

Add to Cursor Add to VS Code Add to Claude Add to ChatGPT Add to Codex Add to Gemini

Rasdaman MCP Server

This tool enables users to interact with rasdaman in a natural language context. By exposing rasdaman functionality as tools via the MCP protocol, an LLM can query the database to answer questions like:

  • "What datacubes are available?"

  • "What are the dimensions of the 'Sentinel2_10m' coverage?"

  • "Create an NDVI image for June 12, 2025."

The MCP server translates these tool calls into actual WCS/WCPS queries that rasdaman can understand and then returns the results to the LLM.

Installation

pip install rasdaman-mcp

Related MCP server: 3DCityDB MCP Server

Usage

The entry point is rasdaman-mcp. It can be run in two primary modes controlled by the --transport command-line argument: stdio (default) and http.

Configuration

The connection from the MCP server to rasdaman can be configured in two ways.

  1. Command-line arguments:

  • --rasdaman-url: URL for the rasdaman server (default RASDAMAN_URL environment variable or http://localhost:8080/rasdaman/ows).

  • --username: Username for authentication (default RASDAMAN_USERNAME environment variable or rasguest).

  • --password: Sets the password for authentication (default RASDAMAN_PASSWORD environment variable or rasguest).

  1. Environment variables:

  • RASDAMAN_URL: URL for the rasdaman server

  • RASDAMAN_USERNAME: Username for authentication

  • RASDAMAN_PASSWORD: Password for authentication

stdio Mode

Used for direct integration with clients that take over managing the server process. It uses standard input/output for communication. Generally in your client configuration you need to specify the command to run the MCP tool:

rasdaman-mcp --username rasguest --password rasguest

Keep in mind that all dependencies are installed, and the venv is activated if necessary.

Example for gemini-cli:

gemini mcp add rasdaman-mcp "rasdaman-mcp --username rasguest --password rasguest"

Benefits:

  • Simplicity: No need to manage a separate server process or ports.

  • Seamless Integration: Tools are transparently made available to the LLM within the client environment.

http Mode

This mode runs a standalone Web server.

  1. Start the server:

     rasdaman-mcp --transport http --host 127.0.0.1 --port 8000 --rasdaman-url "http://localhost:8080/rasdaman/ows"
    
  2. Configure your client to add an MCP server at http://127.0.0.1:8000/mcp. For example, for Mistral Vibe extend the config.toml with a section like this:

     [[mcp_servers]]
     name = "rasdaman-mcp"
     transport = "streamable-http"
     url = "http://127.0.0.1:8000/mcp/"

Benefits:

  • Scalability: The MCP server can be containerized (e.g., with Docker) and deployed as a separate microservice.

  • Decoupling: Any client that can speak HTTP (e.g., curl, Python scripts, web apps, other LLM clients) can interact with the tools.

  • Testing: Allows for direct API testing and debugging, independent of an LLM client.

Development

Setup

  1. Clone the git repository:

    git clone https://github.com/rasdaman/rasdaman-mcp.git
    cd rasdaman-mcp/
  2. Create a virtual environment (if you don't have one):

    uv venv
  3. Activate the virtual environment:

    source .venv/bin/activate
  4. Install from source:

    uv pip install -e .

Core Components

  • Main Application (main.py): This script initializes the FastMCP application. It handles command-line arguments for transport selection, rasdaman URL, username, and password. It then instantiates the RasdamanActions class and decorates its methods to expose them as tools.

  • RasdamanActions Class (rasdaman_actions.py): Encapsulates all interaction with the rasdaman WCS/WCPS endpoints. It is initialized with the server URL and credentials, and its methods contain the logic for listing coverages, describing them, and executing queries.

  • WCPS crash course (wcps_crash_course.py): A short summary of the syntax of WCPS, allowing LLMs to generate more accurate queries.

  • WCPS query validation (query_validator.py): Throws a SyntaxError if a WCPS query has invalid syntax, allowing LLMs to locally validate query syntax.

Defined Tools

The following methods are exposed as tools:

  • list_coverages(): Lists all available datacubes.

  • describe_coverage(coverage_id): Retrieves metadata for a specific datacube.

  • wcps_query_crash_course(): Returns a crash course on WCPS syntax with examples and best practices.

  • validate_wcps_query(wcps_query): Validates the syntax of a WCPS query without executing it.

  • execute_wcps_query(wcps_query): Executes a raw WCPS query and returns a result either directly as a string (scalars or small json), or as a filepath.

Documentation

To build the documentation:

# install dependencies
uv pip install '.[docs]'

sphinx-build docs docs/_build

You can then open docs/_build/index.html in the browser.

Automated Tests

To run the tests:

# install dependencies
uv pip install '.[tests]'

pytest

Manual Testing

Interacting with the standalone HTTP server manually requires a specific 3-step process using curl. The fastmcp protocol is stateful and requires a session to be explicitly initialized.

  1. First, send an initialize request. This will return a 200 OK response and, most importantly, a session ID in the mcp-session-id response header (needed in the next steps).

    curl -i -X POST \
    -H "Accept: text/event-stream, application/json" \
    -H "Content-Type: application/json" \
    -d '{
          "jsonrpc": "2.0",
          "method": "initialize",
          "params": {
            "protocolVersion": "2024-11-05",
            "capabilities": {},
            "clientInfo": { "name": "curl-client", "version": "1.0.0" }
          },
          "id": 1
        }' \
    "http://127.0.0.1:8000/mcp"
  2. Next, send a notification to the server to confirm the session is ready. Use the session ID from Step 1 in the mcp-session-id header. This request will not produce a body in the response.

    SESSION_ID="<YOUR_SESSION_ID>"
    
    curl -X POST \
    -H "Accept: text/event-stream, application/json" \
    -H "Content-Type: application/json" \
    -H "Mcp-Session-Id: $SESSION_ID" \
    -d '{
          "jsonrpc": "2.0",
          "method": "notifications/initialized"
        }' \
    "http://127.0.0.1:8000/mcp"
  3. Finally, you can call a tool using the tools/call method. The params object must contain the name of the tool and an arguments object with the parameters for that tool. The server will respond with the result of the tool call in a JSON-RPC response.

    SESSION_ID="<YOUR_SESSION_ID>"
    
    # Example: Calling the 'list_coverages' tool
    curl -X POST \
    -H "Accept: text/event-stream, application/json" \
    -H "Content-Type: application/json" \
    -H "Mcp-Session-Id: $SESSION_ID" \
    -d '{
          "jsonrpc": "2.0",
          "method": "tools/call",
          "params": {
            "name": "list_coverages",
            "arguments": {}
          },
          "id": 2
        }' \
    "http://127.0.0.1:8000/mcp"

Available Tools

5 tools
describe_coverageC

Retrieves structural metadata for a specific datacube (coverage).

ParametersJSON Schema
NameRequiredDescriptionDefault
coverage_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It implies a read-only operation but fails to detail potential side effects, error handling, or response characteristics (e.g., no mention of what happens if coverage_id is invalid). The description is too minimal to provide adequate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, concise and to the point. It avoids unnecessary words. However, a more structured format (e.g., bullet points) could improve readability for agents, but overall it is appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with one parameter and an output schema (which may mitigate the need for extensive return value description). However, the description does not explain what 'structural metadata' includes or any context like typical use cases. It is minimally adequate for a simple tool but lacks depth.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning the description must compensate for parameter meaning. However, the description only mentions 'specific datacube' without clarifying the format, constraints, or examples for 'coverage_id'. The parameter semantics are largely left to inference.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'retrieves' and the resource 'structural metadata for a specific datacube (coverage)'. It distinguishes from siblings like 'list_coverages' which lists coverages, and 'execute_wcps_query' which runs queries. However, it is somewhat vague about what constitutes 'structural metadata', leaving room for ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No usage guidelines are provided. The description does not indicate when to use this tool versus alternatives like 'list_coverages' or 'execute_wcps_query'. There is no mention of prerequisites or context for optimal use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_wcps_queryB

Executes a Web Coverage Processing Service (WCPS) query in rasdaman. Use this for spatio-temporal subsetting of datacubes, processing, aggregation, or filtering. If the query returns binary data (e.g., an image or NetCDF file), the tool saves it to a temporary file and return the path. Important: Show the actual WCPS query and the result file path to the user.

ParametersJSON Schema
NameRequiredDescriptionDefault
wcps_queryYes

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It mentions that binary data results are saved to a temporary file and the path is returned, and instructs to show the query and path to the user. However, it does not disclose error behavior, side effects (e.g., whether queries can modify data), permissions required, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with no redundancy: first states purpose, second lists use cases, third explains binary handling and user instruction. Structure is logical and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (query execution), the description covers core functionality and binary handling but lacks output format, error behavior, and permissions. The instruction to show the query and path is helpful but not core behavioral context. Adequate but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'wcps_query' has 0% schema description coverage. The description merely calls it 'the WCPS query' without providing syntax, examples, or constraints. The sibling validate_wcps_query could serve as a reference, but the description does not connect to it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it executes a WCPS query in rasdaman and lists specific uses like subsetting, processing, aggregation, and filtering. This distinguishes it from siblings (describe_coverage, list_coverages, validate_wcps_query, wcps_query_crash_course) which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description suggests when to use the tool ('for spatio-temporal subsetting...') but does not explicitly state when not to use it or mention alternatives (e.g., using validate_wcps_query for validation). The guidance is implicit rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_coveragesA

Lists all available datacubes (coverages) in rasdaman.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It adequately states the tool lists all available coverages, but does not mention any behavioral aspects like authorization requirements, performance, or the nature of 'available'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, perfectly concise and front-loaded. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and existence of output schema, the description is mostly complete. It could mention that the output provides coverage names for use with other tools, but this is not essential.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has no parameters (0 params), so baseline is 4. Description does not need to add param info because none exist.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it lists all available datacubes/coverages in rasdaman, with a specific verb and resource. Distinguishes from sibling tools like describe_coverage and execute_wcps_query which serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus siblings. The context implies it could be used to discover coverages before describing or querying, but this is not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

validate_wcps_queryA

Use this to check if your WCPS query is syntactically correct before execution. Returns "VALID" if the query syntax is correct, or "INVALID SYNTAX: " otherwise.

ParametersJSON Schema
NameRequiredDescriptionDefault
wcps_queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations, but description fully discloses behavior: returns 'VALID' or 'INVALID SYNTAX: <error>'. It is a read-only validation with no side effects mentioned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with usage guidance followed by return format. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter validation tool with output schema present, description covers usage context, return values, and relationship to siblings. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter (wcps_query) with 0% schema description coverage. The description implies it is the query string but does not elaborate on format or constraints. Adequate for a simple tool.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool validates WCPS query syntax, using specific verb 'check' and resource 'query'. It distinguishes from sibling tools like execute_wcps_query which runs the query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says to use 'before execution', giving clear context. Does not list when not to use, but the sibling execute_wcps_query implies the alternative for running queries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

wcps_query_crash_courseA

Returns a crash course on writing WCPS queries: learn the basic syntax, common operations, and best practices for WCPS queries. It's recommended to check this before executing queries.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, but description fully discloses that the tool returns educational content with no side effects, making its behavior transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences that front-load the purpose and add a recommendation, with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple informational tool with no parameters, the description fully explains what it returns and why to use it, and the output schema presumably covers structure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so baseline is 4. Description adds no parameter info, which is fine given 100% schema coverage and zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns a crash course on WCPS queries, distinguishing it from sibling tools like execute_wcps_query (execution) and describe_coverage (coverage description).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit recommendation to check this before executing queries provides clear guidance on when to use, though it doesn't elaborate on when not to use or alternatives beyond siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observeddescribe_coverage
    • First observedexecute_wcps_query
    • First observedlist_coverages
    • First observedvalidate_wcps_query
    • First observedwcps_query_crash_course

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: listing coverages, describing a coverage, validating queries, executing queries, and a crash course. There is no overlap in functionality.

Naming Consistency4/5

Most tools follow a verb_noun pattern with snake_case (e.g., describe_coverage, list_coverages). The exception is 'wcps_query_crash_course', which is a noun phrase, but it remains consistent in using underscores.

Tool Count5/5

With 5 tools, the server covers the essential operations for a datacube query service: exploration, validation, execution, and learning. The count is well-scoped for its purpose.

Completeness4/5

The tool set covers the key workflows for WCPS querying: list, describe, validate, and execute. Minor gaps exist, such as missing tools for managing coverages or retrieving example queries, but the core functionality is complete.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Enables natural language interaction with rasdaman multidimensional databases by translating tool calls into WCS/WCPS queries. It allows users to list coverages, retrieve metadata, and execute complex queries on datacubes through an LLM.
    6
    7
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables AI assistants to interact with 3DCityDB v5 through natural language, dynamically resolving object classes, properties, and codelists to answer spatial questions and execute SQL queries on CityGML data.
    14
    12
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides database interaction through natural language, enabling query execution and content processing.
    7
    Apache 2.0
  • A
    license
    B
    quality
    C
    maintenance
    Enables natural language interaction with a GeoServer instance for managing workspaces, datastores, feature types, layers, styles, and OGC services (WMS/WFS) via an LLM-powered agent.
    1
    MIT