When you generate an OpenAPI specification using openapi-gen, the output includes CRUD operation paths for GET, POST, PUT, and DELETE. However, the MCP server excludes POST, PUT, and DELETE operations by default when it loads the specification. This means those operations do not appear as MCP tools, even though they are present in the specification file.

This default behavior is intentional. It prevents write operations from being exposed accidentally and keeps the server in a safe, read-only state until you explicitly opt in.

To make write operations available as MCP tools, you must add route configuration to mcp_server_config.json and restart the server.

How write operations are controlled

The MCP server uses routes.maps in mcp_server_config.json to control which operations are exposed as tools. Rules in the maps array are evaluated in order and the first matching rule wins. For more information, see Configure routes.

The default behavior is equivalent to a global exclusion rule for all mutating methods:
{
  "comment": "Global exclusion of mutating methods (default)",
  "methods": ["POST", "PUT", "DELETE", "PATCH"],
  "mcp_type": "EXCLUDE"
}

To enable write operations for a specific path, add an opt-in rule with "mcp_type": "TOOL" before the global exclusion rule.

Enable write operations for a specific path

The following example enables POST, PUT, and DELETE on the /Orders path while keeping all other write operations excluded:
{
  "api": {
    "openapi": {
      "spec_file": "openapi.yml"
    },
    "routes": {
      "maps": [
        {
          "comment": "Global exclusion of mutating methods (default)",
          "methods": ["POST", "PUT", "DELETE", "PATCH"],
          "mcp_type": "EXCLUDE"
        },
        {
          "comment": "Opt-in allow POST on /Orders for create operation",
          "pattern": "/Orders",
          "methods": ["POST"],
          "mcp_type": "TOOL"
        }
      ]
    }
  }
}
Note: Rule order matters. Place specific opt-in rules before the global exclusion rule, otherwise the exclusion rule matches first, and the opt-in rule is never reached.

Restart the server after changes

After editing mcp_server_config.json, restart the server for the changes to take effect:
mcpgen restart