home / mcp / policy analyzer mcp server

Policy Analyzer MCP Server

Provides an MCP server for the Policy Analyzer API, exposing its OpenAPI-defined capabilities.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ag2-mcp-servers-policy-analyzer-api": {
      "command": "python",
      "args": [
        "mcp_server/main.py",
        "stdio"
      ],
      "env": {
        "CONFIG": "A JSON string containing the configuration.",
        "SECURITY": "Environment variables for security parameters (e.g., API keys)",
        "CONFIG_PATH": "Path to a JSON configuration file (e.g., mcp_server/mcp_config.json)"
      }
    }
  }
}

You expose an MCP server for the Policy Analyzer API so clients can interact with it in a standardized way. This server manages requests, handles model-context operations, and can be wired into your tooling for automated workflows and integrations.

How to use

Start the MCP server in stdio mode and connect your MCP client to it. Use the server as a local service that exposes the Policy Analyzer capabilities to your tooling. Configure the server via environment variables or a JSON config file, then launch a client that sends MCP requests. You can run the server in different transport modes, but stdio is the simplest for local development and testing.

How to install

Prerequisites: Python 3.9 or later, pip, and uv.

Clone the project and install dependencies.

Install steps

git clone <repository-url>
cd mcp-server
pip install -e ".[dev]"
# Or, if you prefer using uv to install the editable dev package:
uv pip install --editable ".[dev]"

Run the server

Use the stdio transport to run the MCP server locally. This starts the server and makes it available to a local MCP client.

python mcp_server/main.py stdio

Configuration and environment

Configure the server using environment variables or a JSON config file. Key variables include the path to the config and security settings.

Environment variables to use

- CONFIG_PATH: Path to a JSON configuration file (for example, mcp_server/mcp_config.json).\n- CONFIG: A JSON string containing the configuration.\n- SECURITY: Environment variables for security parameters (such as API keys).

Final run command example

python mcp_server/main.py stdio

Configuration snippet (example)

{
  "type": "stdio",
  "name": "policy_analy_mcp",
  "command": "python",
  "args": ["mcp_server/main.py", "stdio"],
  "env": [
    {"name": "CONFIG_PATH", "value": "mcp_server/mcp_config.json"},
    {"name": "SECURITY", "value": "API_KEY=YOUR_API_KEY"}
  ]
}
Policy Analyzer MCP Server - ag2-mcp-servers/policy-analyzer-api