MCP server

Ask StagePortal questions in plain language from your AI assistant. It answers by querying the SPARQL endpoint live.

The approach: MCP over SPARQL

The Model Context Protocol (MCP) lets an AI assistant call tools on a server. This server gives the assistant read-only access to the StagePortal SPARQL endpoint: it writes the queries itself and answers from live data, not from what it remembers.

Your AI assistant Writes SPARQL, reads the advice, retries
→
MCP server Schema card, ontology lookup, guardrails
→
SPARQL endpoint Live StagePortal data

SPARQL against StagePortal is easy to get wrong: fields that look like Dublin Core are OMV here, metadata is split across named graphs, and a query against the wrong graph returns zero rows with no error. So the server does more than pass queries through. It gives the assistant:

  • A schema card: every metadata graph with all its predicates, the graph layout and worked query patterns.
  • Ontology lookup, so a name or acronym resolves to the real IRI and current content instead of a guess.
  • Guarded execution. Writes are refused, result sizes are capped, and every failure or empty result comes back with advice on how to repair the query.

Why not retrieval (RAG)? The data here is highly structured: typed records in named graphs, linked by a fixed set of predicates. Questions about it are answered by exact joins, filters and counts, which SPARQL computes and similarity search cannot. And the vocabulary that matters, about 200 predicates across 13 graphs, fits in the assistant's context: retrieval over something that already fits can only lose the predicate it needed. The mistakes that actually happen (invented predicates, the wrong graph, queries too expensive for the endpoint) are fixed by a complete predicate list, ontology lookup, guardrails and a repair loop.

Questions to try

Each one targets a mistake AI assistants commonly make on StagePortal.

Content

In StagePortal, which concepts are narrower than "milling" in the INRAE thesaurus?
"milling" is only an alternative label of broyage, so a search on preferred labels finds nothing. Then one step down the hierarchy, not up.
In StagePortal, what are the French and Spanish labels of the AGROVOC concept "maize"?
Reads the ontology's own content and its language tags.
Sur StagePortal, quel terme désigne « l'action de réduire en fragments plus petits par pression ou chocs » ?
A lookup by meaning, in French. The exact definition exists, so a paraphrase is the wrong answer.

Size and the current version

In StagePortal, which 5 ontologies in the Plants category have the most classes, counting only their current version?
Sizes live in the Metrics graph, not in omv:numberOfClasses. Only the current version counts, and metric values must be sorted as numbers.
In StagePortal, which ontology in the INRAE group is the largest, and how many properties does it have?
Joins a group to sizes, and asks for a size other than classes.

Categories, groups and licenses

In StagePortal, which ontologies in the Soil category also belong to the INRAE group?
A category and a group on the same record: two vocabularies of IRIs, linked by two different predicates.
In StagePortal, which ontologies of the Wheat Data Interoperability group are licensed under CC BY 4.0?
The license sits on the current version, written as an IRI in two ways (http and https): an exact match finds only half.

People and organizations

In StagePortal, which organizations are linked to the most ontologies, and what are their ROR iDs?
Organizations versus people, creators versus contributors.

Projects

In StagePortal, which projects use both AGROVOC and an ontology from the Crop Ontology group?
Projects point to ontologies, not the other way round, and it takes a double join.

Missing data and failed versions

In StagePortal, which ontologies have no license in their current version?
An absent field, without borrowing an archived version's license.
In StagePortal, which ontologies have a version that failed to parse?
The version status, which the worked query patterns barely cover.

Server URL

https://mcp.agroportal.eu/
https://mcp.agroportal.eu/
Streamable HTTP transport. No account or API key needed.

Set it up

Add the server URL to your MCP client. Clients that load servers at startup need a restart.
Claude Code
claude mcp add --transport http agroportal https://mcp.agroportal.eu/
claude mcp add --transport http agroportal https://mcp.agroportal.eu/
opencode
opencode mcp add agroportal --url https://mcp.agroportal.eu/
opencode mcp add agroportal --url https://mcp.agroportal.eu/
VS Code, in .vscode/mcp.json
{ "servers": { "agroportal": { "type": "http", "url": "https://mcp.agroportal.eu/" } } }
{
  "servers": {
    "agroportal": {
      "type": "http",
      "url": "https://mcp.agroportal.eu/"
    }
  }
}
Claude (web and desktop apps)
Settings → Connectors → Add custom connector, then paste the server URL.
Other clients
Any client that supports the Streamable HTTP transport works. Use the server URL, with no authentication.

Tools

get_schema_card Every metadata graph with its predicates and usage counts, the graph layout, categories, groups and worked query patterns.
resolve_ontology An ontology name or acronym → its IRI and the named graph holding its current content.
run_sparql Read-only, guarded execution. Returns rows, or a failure with repair advice.
list_terms The subject categories or groups, with their IRIs.
Each tool call, including the query, is logged to improve the service. No IP address or account is recorded.