Skip to content

SyncAPIM MCP Tools and REST API Reference ​

In accordance with the enterprise-wide single Canonical URL standard, SyncAPIM provides all REST API and Model Context Protocol (MCP) endpoints under the /api/v1/apim/... prefix.

  • Cloud Endpoint: https://apim.empasy.com/api/v1/apim (Demo Portal: https://apim-admin.empasy.io/api/v1/apim)
  • Local Development Ports:
    • Admin UI: http://localhost:3119 (http://apim.localhost)
    • Homepage: http://localhost:5190 (http://apim-home.localhost)
    • JVM #1 (sync-apim-admin): http://localhost:18089
    • JVM #2 (sync-apim-receiver): http://localhost:18090 (TCP 5044 / 5055)
    • JVM #3 (sync-apim-detector): http://localhost:18092
    • JVM #4 (sync-apim-gateway): http://localhost:18091 (http://apim-gw.localhost)

1. Standard MCP Tools Specification (/api/v1/apim/mcp) ​

The SyncVerse central control tower, SyncETA QA agent, and SyncInsight analytics agent autonomously invoke SyncAPIM's 6 core security and governance tools via the JSON-RPC 2.0-based MCP endpoints (POST /api/v1/apim/mcp, GET /api/v1/apim/mcp/sse).

1.1 apim_discover_shadow_apis ​

Detects unregistered (Shadow) API endpoints, duplicate paths, and high-risk (risk_score >= minRiskScore) APIs.

  • Input Parameters (Arguments):
    json
    {
      "host": "api.empasy.com",
      "minRiskScore": 50
    }
  • Example Return Payload:
    json
    {
      "tool": "apim_discover_shadow_apis",
      "totalEndpoints": 10,
      "matchedHighRiskCount": 3,
      "shadowOrDriftedSpecCount": 2,
      "duplicateEndpointCount": 1
    }

1.2 apim_analyze_threat_events ​

Queries SQLi, XSS, SSRF, RCE, and JWT tampering threat detection events from the PostgreSQL 18.6 wapf_detect_event time-series table and analyzes statistics by attack type.

  • Input Parameters (Arguments):
    json
    {
      "host": "api.empasy.com",
      "threatCode": "SQLI",
      "limit": 20
    }

1.3 apim_scan_pii_exposure ​

Scans API request/response data fields (wapf_data_field) and packets for exposure of 8 categories of sensitive information, including resident registration numbers, card numbers, and bank account numbers.

  • Input Parameters (Arguments):
    json
    {
      "endpointUuid": "ep_apim_004"
    }

1.4 apim_manage_security_policy ​

Immediately modifies the block status (block_status: 1 block / 0 unblock) of a specific API endpoint or maps WAF security policies and synchronizes the Redis cache.

  • Input Parameters (Arguments):
    json
    {
      "action": "BLOCK_ENDPOINT",
      "endpointUuid": "ep_apim_008",
      "blockStatus": "1"
    }

1.5 apim_export_openapi_spec ​

Extracts the OpenAPI 3.0.1 JSON specification automatically inferred from live traffic and returns Contract Drift audit results compared against the design specification.

  • Input Parameters (Arguments):
    json
    {
      "endpointUuid": "ep_apim_001",
      "designSpec": "{\"openapi\":\"3.0.1\",\"paths\":{\"/api/v1/shop/orders\":{\"post\":{}}}}"
    }

1.6 apim_receive_watch_defense_pack ​

Receives runtime attack pattern defense packs (ApimDefensePack) compiled and sandbox-verified by SyncWatch, and applies them with zero-downtime hot-swapping to the SqlXssLexicalTokenizer fingerprint matcher and SandboxedDefenseEvaluator.

1.7 agent_execute_task ​

Autonomously executes natural-language security audit and blocking tasks delegated by the SyncVerse control tower using the AgentScope Java ReActAgent loop.


2. 4-JVM Core REST API Specification (/api/v1/apim/...) ​

Responsible JVMFunctional AreaHTTP Method & Canonical EndpointDescription
sync-apim-adminDynamic Menu AuthorizationGET /api/v1/apim/sys/permission/getUserPermissionByTokenReturns the role-based dynamic menu tree (sys_permission) for the authenticated user
sync-apim-adminAPI CatalogGET /api/v1/apim/endpoint/list
GET /api/v1/apim/endpoint/detail
POST /api/v1/apim/endpoint/add
PUT /api/v1/apim/endpoint/edit
API endpoint listing, data field details, path merging, and block status (blockStatus) control
sync-apim-adminOpenAPI Spec & AuditGET /api/v1/apim/spec/list
GET /api/v1/apim/spec/download
POST /api/v1/apim/spec/audit
OpenAPI 3.0.1 spec retrieval/download and Contract Drift comparison audit execution
sync-apim-adminThreat Detection EventsGET /api/v1/apim/event/list
GET /api/v1/apim/event/interval/count
GET /api/v1/apim/event/interval/registry/count
Real-time threat packet queries and time-series aggregation based on PostgreSQL wapf_detect_event
sync-apim-adminSecurity Policies & RulesGET /api/v1/apim/policy/list
POST /api/v1/apim/policy/add
GET /api/v1/apim/rule/list
GET /api/v1/apim/rule/stat
CRUD for 7 security policies and 6 threat detection rules; statistics by attack type and severity
sync-apim-adminPII & AlertsGET /api/v1/apim/sensitivity/list
GET /api/v1/apim/mail/list
POST /api/v1/apim/mail/send
Management of 8 PII masking regexes and dispatch of security alert emails
sync-apim-receiverPacket IngestionPOST /api/v1/apim/receiver/ingest
GET /api/v1/apim/receiver/status
HTTP telemetry packet ingestion (queued to Redis Stream job_queue) and receiver status lookup
sync-apim-detectorReal-Time Detection WorkerPOST /api/v1/apim/detector/inspect
POST /api/v1/apim/detector/rules/reload
GET /api/v1/apim/detector/status
Immediate deep packet inspection, forced reload of detection rules and PII cache, and worker status check
sync-apim-gatewayInline Blocking GatewayGET /api/v1/apim/gateway/blocked
POST /api/v1/apim/gateway/block
POST /api/v1/apim/gateway/unblock
Live blocked endpoint listing and immediate runtime block/unblock control

3. cURL Invocation Examples ​

3.1 Invoking an MCP Tool (apim_discover_shadow_apis) ​

bash
curl -X POST "http://localhost:18089/api/v1/apim/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "req-apim-01",
    "method": "tools/call",
    "params": {
      "name": "apim_discover_shadow_apis",
      "arguments": {
        "minRiskScore": 50
      }
    }
  }'

3.2 Executing a Live-Traffic Contract Drift Audit Against a Design Specification ​

bash
curl -X POST "http://localhost:18089/api/v1/apim/spec/audit" \
  -H "Content-Type: application/json" \
  -d '{
    "uuid": "spec_apim_003"
  }'