Colectica MCP Server
MCP server for Colectica Repository REST API with:
- OpenAPI/Swagger discovery
- operation invocation by OpenAPI operationId or synthesized id (
METHOD_path_segments) - Basic Auth and Bearer Token support
- stdio transport now, optional streamable-http transport switch
1. Install
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
2. Configure
Copy .env.example to .env and set values:
COLECTICA_BASE_URL(your Colectica Portal URL)- either
COLECTICA_BEARER_TOKENorCOLECTICA_USERNAME+COLECTICA_PASSWORD(or both)
Optional:
COLECTICA_OPENAPI_CACHE_TTL_SECONDS(default300; set0to disable cache)COLECTICA_RETRY_MAX_RETRIES(default2)COLECTICA_RETRY_BASE_SECONDS(default0.5)COLECTICA_RETRY_MAX_SECONDS(default8)
3. Run MCP server
stdio (default)
colectica-mcp --transport stdio
streamable-http (optional)
colectica-mcp --transport streamable-http --mount-path /mcp
4. Architecture and hosting diagrams
4.1 Runtime request flow
flowchart LR
U[Developer or App] --> A[AI Agent<br/>Copilot, Foundry, LangChain, LlamaIndex]
A --> M[MCP Client Transport<br/>stdio or streamable-http]
M --> S[Colectica MCP Server]
S --> O[OpenAPI Discovery Cache]
S --> C[Colectica REST API]
C --> R[Colectica Repository Backend]
S --> T[MCP Tools<br/>health, discovery, search, DDI, transaction]
4.2 Hosting options
flowchart TB
subgraph Local
L1[Desktop MCP Host]
L2[colectica-mcp --transport stdio]
L1 --> L2
end
subgraph Container
C1[Docker or Kubernetes]
C2[colectica-mcp --transport streamable-http]
C1 --> C2
end
subgraph Azure
Z1[Azure Functions app in hosting/app]
Z2[Bicep infra in infra/main.bicep]
Z1 --> Z2
end
L2 --> API[Colectica Portal API]
C2 --> API
Z1 --> API
4.3 AI-agent integration pattern
sequenceDiagram
participant Agent as AI Agent
participant MCP as Colectica MCP Server
participant API as Colectica API
Agent->>MCP: health_check()
Agent->>MCP: list_operation_categories()
Agent->>MCP: list_operations_by_category(category)
Agent->>MCP: call_operation(operation_id, arguments)
MCP->>API: Invoke endpoint with auth + retries
API-->>MCP: JSON or XML payload
MCP-->>Agent: Normalized MCP tool response
4.4 Host and configure for AI agents
- Pick transport:
stdiofor local desktop agent clients,streamable-httpfor remote/containerized clients. - Configure environment variables in
.env:COLECTICA_BASE_URL- Auth values (
COLECTICA_BEARER_TOKENorCOLECTICA_USERNAME+COLECTICA_PASSWORD) - Optional retry/cache tuning values
- Start the server with your chosen transport.
- Register this MCP endpoint in your AI agent runtime.
- Initialize agents with discovery-first calls:
health_check,list_operations, then scoped execution calls.
5. Available MCP tools
health_check(auth_mode="auto")list_operations(auth_mode="auto")find_operations(query, auth_mode="auto", limit=50)find_ddi_operations(auth_mode="auto", limit=50)call_operation(operation_id, arguments, auth_mode="auto")call_endpoint(method, path, arguments, auth_mode="auto")operation_details(operation_id, auth_mode="auto")call_operation_paginated(operation_id, arguments, auth_mode="auto", max_pages=20, items_path=None)list_operation_categories(auth_mode="auto")list_operations_by_category(category, auth_mode="auto", limit=200)get_repository_info(auth_mode="auto")get_item(arguments, auth_mode="auto")search(arguments, auth_mode="auto")register_item(arguments, auth_mode="auto")get_item_by_urn(urn, auth_mode="auto")register_item_body(body, auth_mode="auto")get_ddi_fragment(agency, identifier, version=None, auth_mode="auto")get_ddi_set_fragment(agency, identifier, version=None, auth_mode="auto")get_item_json(agency, identifier, version=None, auth_mode="auto")get_item_json_set(agency, identifier, version=None, auth_mode="auto")get_item_json_set_filtered(body, auth_mode="auto")
6. Recommended usage flow
health_checklist_operationslist_operation_categoriesto see API groups (Agency, Comment, Ddi, Event, Item, Permission, Query, Rating, Replication, Repository, Set, Setting, Tag, Token, Transaction, VersionNumber)list_operations_by_categoryto narrow to one groupcall_operationusing operationId and arguments from your Swagger schema
For request bodies, pass arguments.body.
If you prefer to execute directly from HTTP route + verb, use call_endpoint(method, path, arguments, auth_mode).
If your OpenAPI spec does not provide operationId values, use synthesized ids in this format:
METHOD_<normalized_path>- Example:
GET /api/v1/ddi/{agency}/{identifier}->GET_api_v1_ddi_agency_identifier
Optional for non-JSON operations:
arguments.content_type(for exampleapplication/x-www-form-urlencodedormultipart/form-data)
Use operation_details to inspect supported parameters and request body content types before invoking.
For paged endpoints, use call_operation_paginated to aggregate items across pages. The server will follow continuation tokens when available, including body tokens like nextResult for query endpoints.
7. DDI integration workflow
Use this sequence to integrate with DDI-focused Colectica endpoints:
- Call convenience wrappers directly:
get_ddi_fragment,get_ddi_set_fragment,get_item_json,get_item_json_set. - Use
get_item_json_set_filteredfor selective graph traversal. - For advanced/non-wrapped routes, run
find_ddi_operationsand confirm withoperation_details(operation_id). - Execute custom integration calls via
call_operationusing typedargumentsandarguments.body. - For large result sets, switch to
call_operation_paginated.
8. Verification commands
Run Colectica server tool unit tests locally:
python -m unittest tests/test_server_tools.py tests/test_client_pagination.py -v
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Metadata
Release files for colectica-mcp-server 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| colectica_mcp_server-0.3.2.tar.gz | 115.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| colectica_mcp_server-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 170.7 kB
Release files / colectica_mcp_server-0.3.2.tar.gz
| Download URL | colectica_mcp_server-0.3.2.tar.gz |
|---|---|
| Size | 115.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a11eede1cceb88e0e12199d5750700e888b01c45fed8fd16e79b5013a26c4b4
|
|
BLAKE2b-256 checksum How to use checksums |
de266875e9351fc3ffd8af6b12ab0fa0a800d12b6850bf8e85128f69286102b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 25, 2026.
Transparency logRelease files / colectica_mcp_server-0.3.2-py3-none-any.whl
| Download URL | colectica_mcp_server-0.3.2-py3-none-any.whl |
|---|---|
| Size | 55.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
529966788195015494ebb5de0c23979324cbc02f781d66b464b53f0faa5d375f
|
|
BLAKE2b-256 checksum How to use checksums |
041004585d6386dff3f77d24f61cae0d87ae74bef4fdbe4e0ad95e5ea3797a20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 25, 2026.
Transparency logSecurity for colectica-mcp-server 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for colectica_mcp_server-0.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.