Skip to main content
Glama

MCP4GVA - MCP Server para GVA GIS

Servidor MCP (Model Context Protocol) para acceder a la API de GVA GIS (Generalitat Valenciana) - Servicio de Suelo de Actividades.

Endpoint: https://gvagis.icv.gva.es/server/rest/services/Hosted/Suelo_actividades/FeatureServer/2

🎯 Dos Implementaciones Disponibles

Este repositorio contiene dos versiones del mismo servidor MCP para que puedas comparar y aprender:

Versión

Ubicación

Runtime

Comando

🐍 Python

Directorio raíz

Python 3.10+

uvx

📘 TypeScript

typescript/

Node.js 18+

npx

📊 Ver COMPARISON.md para una comparación detallada lado a lado


Python Version (este directorio)

Related MCP server: mcp-arcgis-lakeland

¿Qué es esto?

Un servidor MCP que expone la API de ArcGIS REST de la Generalitat Valenciana para que Claude Desktop (y otras aplicaciones MCP) puedan consultar datos de suelo de actividades directamente.

Instalación

Requisito previo: Instalar uv

Primero necesitas tener uv instalado:

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# O con pip
pip install uv

Opción 1: Usar con uvx (RECOMENDADO)

Esta es la forma más simple - no requiere instalación local. Claude Desktop descargará y ejecutará automáticamente.

Configurar Claude Desktop

Edita el archivo de configuración de Claude Desktop:

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

Añade esta configuración:

{
  "mcpServers": {
    "mcp4gva": {
      "command": "uvx",
      "args": ["mcp4gva"]
    }
  }
}

Nota: Para usar esta opción, el paquete debe estar publicado en PyPI. Para desarrollo local, usa la Opción 2.

Opción 2: Desarrollo local con uvx

Si estás desarrollando o modificando el código:

# 1. Clonar/navegar al repositorio
cd mcp4gva

# 2. Configurar Claude Desktop con ruta local

En claude_desktop_config.json:

{
  "mcpServers": {
    "mcp4gva": {
      "command": "uvx",
      "args": [
        "--from",
        "/ruta/completa/a/mcp4gva",
        "mcp4gva"
      ]
    }
  }
}

Opción 3: Instalación tradicional con pip

# Instalación en desarrollo
cd mcp4gva
pip install -e .

# Configuración en Claude Desktop
{
  "mcpServers": {
    "mcp4gva": {
      "command": "python",
      "args": ["-m", "mcp4gva.server"]
    }
  }
}

3. Reiniciar Claude Desktop

Reinicia Claude Desktop para que cargue el nuevo servidor MCP.

Herramientas Disponibles

El servidor expone 4 herramientas que Claude puede usar:

1. gva_layer_info

Obtiene metadatos de la capa (campos, tipo de geometría, sistema de referencia, extensión).

Parámetros: Ninguno

Ejemplo en Claude:

Usa la herramienta gva_layer_info para ver qué campos tiene la capa de GVA GIS

2. gva_query

Consulta features de la capa con filtros SQL.

Parámetros:

  • where (string, default: "1=1"): Cláusula SQL WHERE

  • out_fields (string, default: ""): Campos a devolver (separados por coma o "")

  • return_geometry (boolean, default: true): Devolver geometría

  • result_record_count (integer, default: 10): Máximo de registros

  • result_offset (integer, default: 0): Offset para paginación

Ejemplo en Claude:

Usa gva_query para obtener los primeros 5 registros donde MUNICIPIO='Valencia'

3. gva_count

Cuenta features que cumplen una condición.

Parámetros:

  • where (string, default: "1=1"): Cláusula SQL WHERE

Ejemplo en Claude:

Cuenta cuántos registros hay en total con gva_count

4. gva_export_geojson

Exporta features a formato GeoJSON.

Parámetros:

  • where (string, default: "1=1"): Filtro SQL

  • out_fields (string, default: "*"): Campos a incluir

  • result_record_count (integer, default: 100): Máximo de features

Ejemplo en Claude:

Exporta a GeoJSON los primeros 20 registros

Ejemplos de Uso en Claude Desktop

Una vez configurado, puedes pedirle a Claude cosas como:

  1. Explorar la capa:

    ¿Qué información tiene la capa de GVA GIS?
  2. Consultar datos:

    Obtén 10 registros de la capa de suelo de actividades
  3. Filtrar por campo:

    Muéstrame todos los registros del municipio de Valencia
  4. Contar registros:

    ¿Cuántos registros hay en total en la capa?
  5. Exportar datos:

    Exporta a GeoJSON los primeros 50 registros

Estructura del Proyecto

mcp4gva/
├── mcp4gva/
│   ├── __init__.py
│   └── server.py          # Servidor MCP principal
├── pyproject.toml         # Configuración del paquete
├── requirements.txt       # Dependencias (legacy)
├── claude_desktop_config.json  # Ejemplo de configuración
├── gva_gis_client.py     # Cliente Python standalone (opcional)
├── examples.py           # Ejemplos de uso del cliente (opcional)
└── README.md

Uso Standalone (sin MCP)

También incluye un cliente Python que puedes usar directamente:

from gva_gis_client import GVAGISClient

client = GVAGISClient()

# Obtener info
info = client.get_layer_info()

# Consultar
result = client.query(where="1=1", result_record_count=10)

# Contar
count = client.count_features()

Ver examples.py para más ejemplos.

Parámetros de Consulta SQL

Operadores básicos

CAMPO = 'valor'
CAMPO > 100
CAMPO >= 100 AND CAMPO <= 200
CAMPO IN ('valor1', 'valor2')
CAMPO LIKE '%texto%'
CAMPO IS NULL
CAMPO IS NOT NULL

Operadores lógicos

CAMPO1 = 'A' AND CAMPO2 > 10
CAMPO1 = 'A' OR CAMPO1 = 'B'
NOT (CAMPO = 'valor')

Debugging

Para ver los logs del servidor MCP y probar que funciona:

# Opción 1: Ejecutar con uvx (recomendado)
uvx mcp4gva

# Opción 2: Ejecutar con uvx desde directorio local
uvx --from . mcp4gva

# Opción 3: Ejecutar directamente con Python
python -m mcp4gva.server

# Opción 4: Con logging detallado
PYTHONPATH=. python -m mcp4gva.server

Los logs aparecerán en la salida estándar. El servidor MCP se comunica por stdio, así que verás JSON si funciona correctamente.

Verificar que uv/uvx está instalado

uv --version
uvx --version

Limitaciones

  • La API puede tener restricciones geográficas (IP)

  • Timeout de 30 segundos por petición

  • Límite de registros por consulta (usar paginación para grandes datasets)

Solución de Problemas

El servidor no aparece en Claude Desktop

  1. Verifica que uv esté instalado: uvx --version

  2. Verifica que el archivo de configuración esté en la ubicación correcta

  3. Revisa que la sintaxis JSON sea válida (usa un validador JSON)

  4. Reinicia Claude Desktop completamente (no solo cerrar ventana)

  5. Revisa los logs de Claude Desktop:

    • macOS: ~/Library/Logs/Claude/

    • Windows: %APPDATA%\Claude\logs\

    • Linux: ~/.config/Claude/logs/

Probar el servidor manualmente

# Desde el directorio del proyecto
uvx --from . mcp4gva

Deberías ver que el proceso se inicia y espera entrada JSON en stdin. Si ves un error, revísalo.

Error: "command not found: uvx"

Necesitas instalar uv:

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Luego reinicia tu terminal o ejecuta:
source ~/.bashrc  # o ~/.zshrc si usas zsh

Error 403 / Access Denied desde la API

La API tiene restricciones geográficas. Asegúrate de que tu IP tiene acceso (normalmente funciona desde España).

El paquete no se encuentra con uvx

Si usas desarrollo local, asegúrate de usar --from:

{
  "command": "uvx",
  "args": ["--from", "/ruta/absoluta/a/mcp4gva", "mcp4gva"]
}

Verificar dependencias

# Con uvx (crea entorno temporal y verifica)
uvx --from . mcp4gva --help

# Con pip (si instalaste localmente)
python -c "import mcp; import requests; print('Dependencias OK')"

Recursos

Licencia

Este proyecto es código abierto. Los datos pertenecen a la Generalitat Valenciana.

Available Tools

4 tools
gva_countC

Count features matching a WHERE clause

ParametersJSON Schema
NameRequiredDescriptionDefault
whereNoSQL WHERE clause (e.g., '1=1' for all)1=1

TDQS

C2.9/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 but only states the basic function. It doesn't disclose behavioral traits like whether this is a read-only operation, performance implications, error handling for invalid SQL, or if it requires specific permissions. The description is minimal and lacks necessary context for safe use.

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?

The description is a single, efficient sentence that directly states the tool's function without any wasted words. It is appropriately sized and front-loaded, making it easy to grasp quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool that performs data operations. It doesn't explain what 'features' are, the data source, return format (e.g., integer count), or error cases, leaving significant gaps in understanding for effective use.

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?

The input schema has 100% description coverage, fully documenting the 'where' parameter with examples. The description adds no additional meaning beyond the schema, such as explaining valid SQL syntax or constraints, so it meets the baseline of 3 where the schema does the heavy lifting.

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 action ('Count') and target ('features matching a WHERE clause'), making the purpose understandable. However, it doesn't specify what type of features or from what source (e.g., database table, GIS layer), nor does it differentiate from sibling tools like gva_query which might also involve filtering.

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?

The description provides no guidance on when to use this tool versus alternatives such as gva_query or gva_layer_info. It mentions a WHERE clause but doesn't explain scenarios where counting is preferred over querying or exporting, leaving usage context implied at best.

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

gva_export_geojsonC

Export features to GeoJSON format

ParametersJSON Schema
NameRequiredDescriptionDefault
whereNoSQL WHERE clause to filter features1=1
out_fieldsNoComma-separated field names or '*' for all*
result_record_countNoMaximum number of features to export

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Export' implies a read operation that outputs data, the description doesn't mention whether this tool is safe (non-destructive), has rate limits, requires authentication, or what the output format entails beyond 'GeoJSON format'. This leaves significant behavioral gaps.

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?

The description is extremely concise—a single, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function without unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (exporting data with filtering and field selection), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects, usage context, or output details, leaving the agent with insufficient information to use the tool effectively beyond basic parameter passing.

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?

The description adds no parameter-specific information beyond what's already in the input schema, which has 100% coverage. The schema fully documents all three parameters (where, out_fields, result_record_count) with clear descriptions and defaults. The description doesn't compensate or provide additional context, so it meets the baseline of 3.

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 action ('Export') and the resource ('features to GeoJSON format'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its siblings (gva_count, gva_layer_info, gva_query), which all appear to work with similar geospatial data but 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 Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings or alternatives. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent must infer usage from the tool name and description alone.

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

gva_layer_infoA

Get metadata information about the GVA GIS layer (fields, geometry type, spatial reference, extent)

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It indicates a read operation ('Get metadata information'), which suggests non-destructive behavior, but does not disclose other traits such as authentication needs, rate limits, or response format. The description adds basic context but lacks detailed behavioral disclosure.

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?

The description is a single, efficient sentence that front-loads the core purpose ('Get metadata information') and lists specific metadata types without waste. Every word contributes to understanding the tool's function, making it appropriately sized and well-structured.

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 simplicity (0 parameters, no output schema), the description is adequate but could be more complete. It explains what metadata is retrieved but does not cover the return format or any error conditions. Without annotations or output schema, additional context on behavioral aspects would enhance completeness for this read-only tool.

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?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description appropriately does not discuss parameters, focusing instead on the tool's purpose. This meets the baseline for tools with no parameters, as it avoids unnecessary details.

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 verb 'Get' and the resource 'metadata information about the GVA GIS layer', specifying the exact types of information returned (fields, geometry type, spatial reference, extent). It distinguishes from siblings like gva_count, gva_export_geojson, and gva_query by focusing on metadata retrieval rather than counting, exporting, or querying data.

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 implies usage for obtaining layer metadata, but does not explicitly state when to use this tool versus alternatives like gva_query for data access or gva_export_geojson for exporting. No exclusions or prerequisites are mentioned, leaving usage context inferred rather than clearly defined.

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

gva_queryC

Query features from the GVA GIS layer with SQL-like WHERE clause and optional parameters

ParametersJSON Schema
NameRequiredDescriptionDefault
whereNoSQL WHERE clause (e.g., '1=1' for all, 'MUNICIPIO="Valencia"')1=1
out_fieldsNoComma-separated field names or '*' for all fields*
return_geometryNoWhether to return geometry data
result_record_countNoMaximum number of records to return
result_offsetNoOffset for pagination

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'SQL-like WHERE clause and optional parameters' but fails to describe critical behaviors such as authentication requirements, rate limits, error handling, or the format of returned data (especially given no output schema). This leaves significant gaps for an agent to understand how to interact with the tool effectively.

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?

The description is a single, efficient sentence that front-loads the core purpose ('Query features from the GVA GIS layer') and adds essential detail ('with SQL-like WHERE clause and optional parameters'). Every word earns its place with zero waste.

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

Completeness2/5

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

Given the complexity of a query tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It lacks details on authentication, rate limits, error cases, and the structure of returned data (e.g., geometry format, pagination behavior). This leaves the agent poorly equipped to handle real-world usage scenarios.

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?

Schema description coverage is 100%, so the input schema fully documents all 5 parameters with descriptions and defaults. The description adds minimal value beyond this, mentioning 'SQL-like WHERE clause and optional parameters' but not elaborating on parameter interactions or usage nuances. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Query features') and resource ('from the GVA GIS layer'), specifying it uses a SQL-like WHERE clause with optional parameters. It distinguishes from siblings like gva_count (counting) and gva_export_geojson (exporting), but doesn't explicitly differentiate from gva_layer_info (which likely provides metadata).

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 explicit guidance on when to use this tool versus alternatives like gva_count or gva_export_geojson is provided. The description implies usage for querying features with filtering, but lacks context on prerequisites, performance considerations, or specific scenarios where other tools might be more appropriate.

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

TDQS

B3.4/5.0
Disambiguation4/5

The tools have mostly distinct purposes: gva_count counts features, gva_export_geojson exports data, gva_layer_info provides metadata, and gva_query retrieves features. However, gva_count and gva_query both involve WHERE clauses and could be slightly confused for simple counting tasks, though their outputs differ (count vs. feature list).

Naming Consistency5/5

All tool names follow a consistent 'gva_' prefix with descriptive snake_case suffixes (e.g., count, export_geojson, layer_info, query). This pattern is uniform and predictable across all four tools, making them easy to identify and understand.

Tool Count4/5

With 4 tools, the count is reasonable for a GIS data server, covering core operations like querying, exporting, counting, and metadata retrieval. It might benefit from additional tools for updates or spatial analysis, but it's well-scoped for basic interactions.

Completeness3/5

The tools cover read operations (query, count, export, metadata) well for a GIS layer, but there are notable gaps: no create, update, or delete tools, which limits full CRUD lifecycle coverage. This could cause agent failures if modifications are needed, though it's sufficient for query and export workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pepo1275/mcp4gva'

If you have feedback or need assistance with the MCP directory API, please join our Discord server