AdminProcedureQueryService
Facilitates structured retrieval of administrative process metadata from the eRegulations data repository using a standardized Model Context Protocol interface. This service significantly improves the capacity of intelligent agents to furnish precise guidance on regulatory workflows, necessary paperwork, and associated financial obligations by offering normalized API access.
Author

unctad-ai
Quick Info
Actions
Tags
eRegulations Data Access Protocol Implementation
A Model Context Protocol (MCP) intermediary layer designed to interface with the eRegulations Application Programming Interface (API). This server abstracts the underlying complexity, presenting data regarding regulatory mandates, sequential phases, prerequisites, and expenditure in an AI-optimized format, thereby streamlining automated query resolution.
Core Capabilities
- Standardized protocol access to the entire eRegulations dataset.
- Querying capabilities covering regulatory sequences, granular steps, compliance criteria, and associated monetary values.
- Integration of MCP standard templates to optimize Large Language Model (LLM) utilization of the exposed functionalities.
- Simplified deployment via conventional Standard Input/Output stream communication.
Deployment Instructions
Preferred Method: Containerization via Docker
Execution through the container image published on the GitHub Container Registry (GHCR) is the suggested deployment path, guaranteeing an immutable and isolated runtime environment.
bash
Retrieve the latest image (optional step)
docker pull ghcr.io/unctad-ai/eregulations-mcp-server:latest
Initiate the server instance, specifying the destination eRegulations API endpoint
export EREGULATIONS_API_URL="https://your-eregulations-api.com" docker run -i --rm -e EREGULATIONS_API_URL ghcr.io/unctad-ai/eregulations-mcp-server
Please substitute https://your-eregulations-api.com with the actual root URL for the specific eRegulations platform you intend to query (e.g., https://api-tanzania.tradeportal.org).
The server processes incoming MCP formatted requests delivered via STDIN and outputs results to STDOUT.
Example Client Integration Configuration
This JSON snippet illustrates how an autonomous client (such as a high-level AI agent) might be configured to invoke this server utilizing Docker:
{ "mcpServers": { "eregulations": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "EREGULATIONS_API_URL", "ghcr.io/unctad-ai/eregulations-mcp-server:latest" ], "env": { "EREGULATIONS_API_URL": "https://your-eregulations-api.com" } } } }
(Ensure the environment variable configuration mirrors the one set for the Docker execution.)
Deployment via Smithery Utility
Alternatively, installation and launch can be managed using the Smithery orchestration tool:
Navigate to https://smithery.ai/server/@unctad-ai/eregulations-mcp-server to retrieve the necessary execution command.
Installation via npm Registry (Legacy/Discouraged)
~~Direct invocation via npx is no longer endorsed due to potential disparities in execution environments.~~
~~bash
Deprecated method: Set environment variables and execute via npx
export EREGULATIONS_API_URL=https://example.com/api && export NODE_ENV=production && npx -y @unctad-ai/eregulations-mcp-server@latest
`~~
Configuration Requirements
The server's fundamental requirement is the Uniform Resource Locator (URL) pointing to the target eRegulations API endpoint.
Environmental Parameters
EREGULATIONS_API_URL: (Mandatory) The base URL for the administrative procedure API (e.g.,https://api-tanzania.tradeportal.org). This value must be relayed to the Docker container using the environment flag (-e).
Exposed Functionalities
The MCP intermediary exposes the following distinct callable tools:
listProcedures
Retrieves a catalog of all administrative procedures available within the connected eRegulations system.
getProcedureDetails
Fetches comprehensive descriptive data for a procedure identified by its unique identifier.
Parameters:
procedureId: The unique identifier corresponding to the desired procedure record.
getProcedureStep
Retrieves specific metadata pertaining to an individual phase within a defined procedure.
Parameters:
procedureId: The identifier of the encompassing procedure.stepId: The identifier for the targeted step within that procedure.
searchProcedures
Executes a broad search across procedures based on a textual input. Caveat: Current implementation relies on searching associated objectives within the underlying API, which might yield results broader than direct procedure titles.
Parameters:
keyword: The search term or phrase to match against.
Standardized Prompt Directives
The server furnishes pre-defined prompt templates specifically engineered to guide LLMs in correctly invoking the available functionalities. Clients supporting the MCP template specification will automatically ingest these guides to enhance their competence in leveraging the API resources.
Development Workflow
bash
Launch in a development or debugging context
npm run start
Execute comprehensive verification routines
npm test
Execute tests and maintain monitoring for automatic re-runs on code changes
npm run test:watch
Run a simulation client for testing purposes
npm run test-client
WIKIPEDIA: XMLHttpRequest (XHR) represents an Application Programming Interface realized as a JavaScript object, whose member functions facilitate the transmission of HyperText Transfer Protocol (HTTP) queries originating from a web browser environment toward a backend web server. These methods empower browser-based applications to dispatch requests post-page rendering completion and subsequently receive relayed data. XMLHttpRequest forms a core constituent of Asynchronous JavaScript and XML (Ajax) programming paradigms. Before the advent of Ajax, reliance was primarily placed on standard hyperlink navigation and form submissions for server interaction, procedures that frequently necessitated a complete page reload.
== Chronology == The conceptual foundation for XMLHttpRequest was first formulated in the year 2000 by the development team behind Microsoft Outlook. This concept subsequently manifested as an implementation within the Internet Explorer 5 browser release (1999). Nevertheless, the initial invocation syntax did not employ the 'XMLHttpRequest' identifier; instead, developers utilized object instantiation via 'ActiveXObject("Msxml2.XMLHTTP")' and 'ActiveXObject("Microsoft.XMLHTTP")'. As of Internet Explorer version 7 (released in 2006), universal browser support for the 'XMLHttpRequest' identifier became standard. The 'XMLHttpRequest' identifier has since attained de facto standardization across all principal web browsers, encompassing Mozilla's Gecko rendering engine (2002), Safari version 1.2 (2004), and Opera version 8.0 (2005).
=== Formal Specification Development === The World Wide Web Consortium (W3C) published the initial Working Draft specification detailing the XMLHttpRequest object on April 5, 2006. Subsequently, on February 25, 2008, the W3C advanced to a Level 2 Working Draft specification. This Level 2 revision introduced enhanced capabilities such as progress monitoring methods, facilitation of cross-site data transfer, and improved handling of raw byte streams. By the conclusion of 2011, the features outlined in the Level 2 specification were integrated back into the primary specification document. Towards the end of 2012, stewardship for ongoing development was transferred to the WHATWG organization, which currently maintains a dynamic living document defined using Web Interface Definition Language (Web IDL).
== Operational Use Pattern == Generally, dispatching a query utilizing XMLHttpRequest involves several distinct programmatic stages:
- Instantiation of an XMLHttpRequest object via its constructor call:
- Invocation of the 'open' method to delineate the request methodology (GET, POST, etc.), specify the target resource path, and select between synchronous or asynchronous execution modes:
- For asynchronous operations, assignment of an event handler function designed to be notified upon changes in the request's operational state:
- Commencement of the data transmission process by executing the 'send' method:
- Responding to state transitions within the registered event listener. Upon successful data receipt from the server, the payload is typically accessible within the 'responseText' attribute. When the object transitions to state 4, signifying completion, processing concludes. Beyond these foundational steps, XMLHttpRequest provides extensive controls over request transmission parameters and response parsing mechanisms. Custom header fields can be appended to the outgoing request to convey specific server fulfillment instructions, and payload data can be transmitted server-side via parameters passed to the 'send' call. Response data can be automatically deserialized from JSON format into native JavaScript objects or processed incrementally as segments arrive, avoiding mandatory waiting for the entire payload. Furthermore, the request can be preemptively canceled or configured to automatically fail if completion is not achieved within a defined time threshold.
== Inter-Domain Requests ==
During the nascent phase of the World Wide Web's evolution, mechanisms were established that permitted data retrieval across different security origins (domains), a capability found to be susceptible to security vulnerabilities.

