Skip to main content
Glama
OpenICGC

mapicgc-mcp

Official
by OpenICGC

mapicgc-mcp

Servidor MCP (Model Context Protocol) que ensenya assistents d'IA (opencode, Claude, Cursor, GitHub Copilot...) a utilitzar correctament la llibreria mapicgc-gl-js de l'ICGC (documentació: https://openicgc.github.io/mapicgc-doc/).

Aquest MCP no executa ni empaqueta mapicgc-gl-js: només serveix text i dades (documentació, exemples de codi i la configuració d'estils/capes de l'ICGC) perquè un model d'IA sàpiga quina API fer servir i com.

English version below ⬇️ / Versió en anglès més avall


Què és?

mapicgc-gl-js és un embolcall de MapLibre GL JS amb funcions específiques per treballar amb les dades i serveis de l'ICGC (estils, capes vectorials i ràster, terrenys 3D, geocodificador, cerca territorial...). Aquest MCP exposa aquesta informació com a eines, recursos i prompts de l'estàndard Model Context Protocol, perquè qualsevol client MCP pugui consultar-la en temps real sense que calgui enganxar documentació manualment al context.

Related MCP server: mapbox-docs

Instal·lació

No cal instal·lar-lo manualment: qualsevol client MCP el pot executar amb npx:

npx -y mapicgc-mcp

Si vols treballar-hi en local (clonant aquest repositori):

npm install
npm run sync    # descarrega la documentació real de mapicgc-gl-js a content/
npm run build   # compila TypeScript a dist/
npm start        # mode stdio
# o
npm run start:http   # mode Streamable HTTP (PORT configurable, per defecte 3000)

Configuració per client MCP

opencode

Afegeix al teu opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mapicgc": {
      "type": "local",
      "command": ["npx", "-y", "mapicgc-mcp"],
      "enabled": true
    }
  }
}

Per a una versió desplegada per URL (Streamable HTTP):

{
  "mcp": {
    "mapicgc": {
      "type": "remote",
      "url": "https://el-teu-domini.exemple/mcp"
    }
  }
}

Claude Desktop

A claude_desktop_config.json:

{
  "mcpServers": {
    "mapicgc": {
      "command": "npx",
      "args": ["-y", "mapicgc-mcp"]
    }
  }
}

VS Code (GitHub Copilot)

A .vscode/mcp.json del teu projecte (o a la configuració d'usuari de VS Code):

{
  "servers": {
    "mapicgc": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mapicgc-mcp"]
    }
  }
}

Eines (tools)

Eina

Descripció

get_started

Instal·lació (NPM i CDN) i exemple mínim de mapa.

search_docs(query, limit?)

Cerca per paraules clau a tota la documentació empaquetada.

get_api(name)

Documentació d'un mètode o classe concret (p. ex. Map.addMarker).

get_example(topic)

Exemple de codi complet per a un tema (terreny 3D, marcadors, geocodificador...).

list_styles

Estils, terrenys i grups de capes disponibles (en viu, amb còpia local de seguretat).

get_changelog(version?)

Historial de canvis complet, o d'una versió concreta.

També registra els recursos mapicgc://readme i mapicgc://changelog, i el prompt crear_mapa(estil, ubicacio).

Nota honesta: el README de mapicgc-gl-js esmenta "mapes estàtics" i un "motor de cerca de CRS" com a capacitats de la llibreria, però aquests mètodes no existeixen al codi font actual. Les capacitats reals i documentades aquí són: geocodificació (addGeocoderICGC), geolocalització (addGeolocateControl), exportació de la vista a imatge/PDF (addExportControl) i cerca territorial per clic (addApiTerritorialICGC / searchApiTerritorialICGC).

Actualitzar el contingut

La documentació de content/ (README, referència de l'API i el CHANGELOG de mapicgc-gl-js, més la còpia de seguretat de la configuració de l'ICGC) es descarrega amb:

npm run sync

Els exemples de content/examples/ estan escrits a mà (basats en exemples reals del repositori de mapicgc-gl-js) i no es regeneren amb sync.

Publicar

npm run sync && npm run build
npm pack --dry-run   # revisa què s'empaquetaria
npm publish

mapicgc-mcp (English)

An MCP (Model Context Protocol) server that teaches AI assistants (opencode, Claude, Cursor, GitHub Copilot...) how to correctly use the mapicgc-gl-js library from ICGC (docs: https://openicgc.github.io/mapicgc-doc/).

This MCP does not run or bundle mapicgc-gl-js: it only serves text and data (documentation, code examples, and the ICGC style/layer configuration) so an AI model knows which API to use and how.

Installation

No manual install needed — any MCP client can run it with npx:

npx -y mapicgc-mcp

For local development (cloning this repo):

npm install
npm run sync    # downloads the real mapicgc-gl-js docs into content/
npm run build   # compiles TypeScript to dist/
npm start        # stdio mode
# or
npm run start:http   # Streamable HTTP mode (PORT env var, default 3000)

Client configuration

See the Catalan section above for ready-to-use JSON snippets for opencode, Claude Desktop and VS Code — the configuration is identical regardless of language.

Tools

Tool

Description

get_started

Installation (NPM and CDN) and a minimal working map example.

search_docs(query, limit?)

Keyword search across all bundled documentation.

get_api(name)

Detailed docs for a specific method/class (e.g. Map.addMarker).

get_example(topic)

A complete code example for a topic (3D terrain, markers, geocoder...).

list_styles

Available styles, terrains and layer groups (live, with a local fallback).

get_changelog(version?)

Full changelog, or just one version's entries.

It also registers the mapicgc://readme and mapicgc://changelog resources, and the crear_mapa(estil, ubicacio) prompt.

Honesty note: the mapicgc-gl-js README mentions "static maps" and a "CRS search engine" as library capabilities, but no such methods exist in the current source code. The real, documented capabilities covered here are: geocoding (addGeocoderICGC), geolocation (addGeolocateControl), exporting the current view to an image/PDF (addExportControl), and click-based territorial lookup (addApiTerritorialICGC / searchApiTerritorialICGC).

Updating content

Everything under content/ that comes straight from mapicgc-gl-js (README, API reference, CHANGELOG, and the ICGC config fallback snapshot) is downloaded with:

npm run sync

Files under content/examples/ are hand-written (based on real examples from the mapicgc-gl-js repository) and are not regenerated by sync.

Publishing

npm run sync && npm run build
npm pack --dry-run   # review what would be published
npm publish

License

BSD-3-Clause, same as mapicgc-gl-js. See LICENSE.

Available Tools

6 tools
get_apiDocumentació d'un mètode o classe de mapicgc-gl-jsA

Retorna la documentació detallada (paràmetres, tipus i descripció) d'un mètode o classe concret de mapicgc-gl-js, p. ex. 'Map.addMarker', 'addGeocoderICGC' o 'Config.getConfigICGC'. Fes servir aquesta eina quan ja saps (o intueixes) el nom exacte de la funció.

NameRequiredDescriptionDefault
nameYesNom del mètode o classe, amb o sense prefix 'Map.', p. ex. 'addMarker' o 'Map.addMarker'.

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses that the tool returns parameters, types, and descriptions, but it does not say what happens when the name is not found, whether matching is exact or fuzzy, or whether class docs include inherited methods.

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 what is returned and followed by the usage condition. Every clause adds information without waste.

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?

For a one-parameter read-only documentation lookup with no output schema, the description is mostly complete: it explains what content is returned and when to use the tool. The main missing piece is not-found or fallback behavior.

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?

Schema coverage is 100%, so the baseline is 3. The description nevertheless adds useful examples such as 'addGeocoderICGC' and 'Config.getConfigICGC', which illustrate class-qualified names beyond the schema's simpler 'addMarker' or 'Map.addMarker' example.

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?

States a specific verb and resource: returns detailed documentation for a concrete mapicgc-gl-js method or class. The phrase 'quan ja saps (o intueixes) el nom exacte' implicitly distinguishes it from the sibling search_docs tool.

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 this tool when you already know or can guess the exact function name. It does not explicitly name search_docs as the alternative for unknown names, but the condition makes the intended routing clear.

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

get_changelogHistorial de canvis de mapicgc-gl-jsA

Retorna el CHANGELOG de mapicgc-gl-js, o només les entrades d'una versió concreta si se'n indica una (p. ex. '1.0.0').

NameRequiredDescriptionDefault
versionNoVersió concreta a consultar, p. ex. '1.0.0'. Omet-la per veure tot l'historial.

TDQS

A3.8/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 disclosure burden. It implies a read-only lookup, but says nothing about the return format (raw markdown text?), size, pagination, or whether a non-existent version errors or returns empty — gaps for a tool with zero annotation coverage.

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?

A single well-formed sentence that front-loads the default behaviour and then the conditional narrowing. Nothing is wasted.

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?

For a one-optional-parameter read tool with no output schema, the description plus schema give an agent everything needed to invoke it correctly. Only the return-shape ambiguity keeps it from being fully complete.

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 coverage is 100% and the single parameter already documents the version example and the omit-for-full-history behaviour. The description largely repeats that same semantic rather than adding matching rules (exact string vs semver, case sensitivity), so it earns the baseline 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 names a specific verb (retorna) and a specific resource (the CHANGELOG of mapicgc-gl-js), plus the narrowed scope of a single version. It is clearly distinct from the sibling tools (get_api, search_docs, get_example), though it does not explicitly state that differentiation.

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?

It spells out both modes of use: omit the version to get the whole history, or pass a version like '1.0.0' to get only that release's entries. It gives no when-not guidance or alternatives, but the conditional branch is explicit and enough to pick the call shape.

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

get_exampleExemple de codi de mapicgc-gl-jsA

Retorna un exemple de codi complet i funcional per a un tema concret de mapicgc-gl-js (mapa bàsic, canviar d'estil, marcadors, terreny 3D, geocodificador, capes ICGC, comparador de mapes, exportar, etc.). Els exemples estan basats en l'API real de la llibreria.

NameRequiredDescriptionDefault
topicYesTema de l'exemple, p. ex. 'terreny 3D', 'marcadors', 'canviar estil', 'geocodificador'.

TDQS

A3.5/5.0
Behavior3/5

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

No annotations, so the description carries the burden. It does add that examples are 'complet i funcional' and 'based on the real library API', which signals output quality, but says nothing about format/length of the returned snippet, whether it is read-only, or any 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?

Two tight sentences, front-loaded with the return value, followed by the topic enumeration. Nothing redundant or padded.

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?

For a one-parameter, no-output-schema tool the description covers what it returns conceptually, but leaves the shape of the response (snippet only? multiple files? framework version?) unspecified, which matters for a code-generation tool.

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 coverage is 100% and the single 'topic' parameter is already documented with examples in the schema. The description's topic list partially duplicates that, adding a few extra valid values but no new syntax or constraints.

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?

States a specific verb and resource: returns a complete, working code example for a given mapicgc-gl-js topic, and enumerates the topic space. It does not distinguish itself from siblings like get_started, get_api, or search_docs, so an agent must infer the split.

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?

Usage is only implied by 'per a un tema concret' — the agent can guess this is for copy-paste-ready samples rather than reference docs, but no explicit when-to-use or when-to-prefer-get_api/get_started is given despite obvious sibling overlap.

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

get_startedPrimers passos amb mapicgc-gl-jsA

Retorna les instruccions d'instal·lació (NPM i CDN) i un exemple mínim de mapa funcional amb mapicgc-gl-js. Útil com a primer pas quan algú vol començar un projecte nou amb la llibreria.

NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden. It clearly discloses what the tool returns—installation instructions and a minimal functional map example—which implies a read-only retrieval operation, though it does not explicitly state that there are no side effects.

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 two sentences, front-loaded with the concrete deliverables and followed by a concise usage cue. Every sentence earns its place with no redundancy.

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?

For a zero-parameter retrieval tool with no output schema and no annotations, the description is nearly complete: it explains what is returned and when to use it. The main gap is that it does not explicitly differentiate this tool from get_example, which also sounds example-oriented.

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 zero parameters, so there are no parameter semantics to explain. The baseline for a parameterless tool is 4, and the description appropriately focuses on output content instead.

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 states a specific verb and resource: it returns installation instructions (NPM and CDN) plus a minimal working map example using mapicgc-gl-js. This is clear enough for an agent to understand the tool, though it does not explicitly distinguish the content from sibling tools like get_example or search_docs.

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?

It gives a clear usage context: useful as a first step when someone wants to start a new project with the library. It does not state when not to use it or name alternatives, but the intended scenario is explicit.

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

list_stylesEstils, capes i terrenys disponibles a l'ICGCA

Consulta en viu la configuració de l'ICGC (amb una còpia local de seguretat si la xarxa falla) i retorna els estils de mapa base, els terrenys 3D i els grups de capes (Orto, Vector, VectorAdmin, FGBAdmin, WMS) disponibles per usar amb mapicgc-gl-js.

NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose useful behavior: it queries live configuration and falls back to a local backup if the network fails. It still omits auth/permission needs, rate limits, and the exact shape or size of the returned configuration.

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 definition is a single dense sentence that front-loads the live-query behavior and then lists the returned resource categories. There is no filler, and the parenthetical fallback note earns its place.

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?

For a zero-parameter listing tool with no output schema, the description names the returned categories and the network-fallback behavior. It does not describe the structure of the returned configuration in detail, but it is otherwise complete enough for an agent to call it correctly.

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 zero parameters, so the baseline is 4. The description does not need to explain parameter semantics, and it correctly focuses on the returned resources instead.

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 states a specific verb ('Consulta en viu ... i retorna') and enumerates the resources returned: base map styles, 3D terrains, and layer groups. It is clear what the tool does, though it does not explicitly distinguish itself from the documentation-oriented sibling tools.

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?

Usage is implied by 'disponibles per usar amb mapicgc-gl-js' and the live/fallback behavior, suggesting this is for retrieving current ICGC configuration. However, it gives no explicit when-to-use versus alternatives such as get_api or search_docs, and no exclusions.

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

search_docsCerca a la documentació de mapicgc-gl-jsA

Cerca per paraules clau a tota la documentació empaquetada de mapicgc-gl-js (README, referència de l'API i exemples) i retorna els fragments més rellevants amb el fitxer d'origen. Fes servir aquesta eina per trobar informació quan no saps el nom exacte d'un mètode o tema.

NameRequiredDescriptionDefault
limitNoNombre màxim de resultats a retornar (per defecte 5).
queryYesParaules clau a cercar, p. ex. 'terreny 3D' o 'geocodificador'.

TDQS

A3.8/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 disclosure burden. It does well on scope (all packaged docs) and on output (relevant fragments with source file), and 'paraules clau' signals keyword rather than semantic matching. It says nothing about ranking, result volume beyond the limit param, or whether results are truncated, which matters for a search tool with no annotation coverage.

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 with no waste: the first covers what is searched and what comes back, the second covers when to reach for it. The constraint/use case is front-loaded and nothing is repeated from the schema.

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?

With 2 flat parameters, an output-schema-less return value that is described, and no nested objects, the definition is nearly sufficient to call the tool correctly. The remaining gap is that it does not indicate result volume behaviour or that the tool covers only packaged docs of this one library, which would help an agent avoid expecting external or version-specific sources.

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 coverage is 100% and both parameters carry their own descriptions including a default and an example for query, so the schema does the heavy lifting. The description's only contribution is the phrase 'paraules clau', which matches the query param without adding syntax or format detail. Baseline 3 applies.

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?

States a specific verb (cerca per paraules clau) and an explicit resource scope: the entire packaged documentation of mapicgc-gl-js, enumerated as README, API reference and examples. It also states the return shape (most relevant fragments plus source file). It stops short of naming the sibling it contrasts with (get_api, get_example), so it is clear but not fully differentiated.

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?

Gives an explicit triggering condition: use it to find information when you don't know the exact name of a method or topic. That condition implicitly routes exact-name lookups to get_api/get_example, but those siblings are never named and no when-not guidance is given.

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. 6 tool updatesv0.1.0
    • First observedget_api
    • First observedget_changelog
    • First observedget_example
    • First observedget_started
    • First observedlist_styles
    • First observedsearch_docs

TDQS

A3.9/5.0

Scored across 6 tools

Disambiguation4/5

Each tool targets a distinct documentation need (changelog, onboarding, keyword search, exact API lookup, topic examples, live style config). The only mild overlaps are get_started vs get_example (both return sample code) and search_docs vs get_api (both retrieve docs), but the descriptions clearly frame when to use each (exact name vs keyword, first-step vs full example).

Naming Consistency5/5

All six tools follow a consistent snake_case verb_noun pattern (get_changelog, get_started, get_api, get_example, search_docs, list_styles). Verbs are used meaningfully: get_ for retrieval, search_ for querying, list_ for enumerating.

Tool Count5/5

Six tools is a well-scoped set for a library documentation/assistant server. Each tool covers a distinct entry point (onboarding, search, API ref, examples, styles, changelog) with no filler.

Completeness4/5

The surface covers the main lifecycle of using a mapping library: getting started, finding docs, exact API reference, runnable examples, live style/terrain config, and version history. Minor gaps exist (e.g., no way to list available example topics or API symbols without guessing), but agents can work around this via search_docs.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers