Summary
When attaching an MCP server to an OpenClaw-backed LAP agent, the OpenClaw bridge writes _litellmAgentPlatform metadata into /data/.openclaw/openclaw.json.
However, OpenClaw config validation rejects this unknown key:
Invalid config at /data/.openclaw/openclaw.json:
- <root>: Unrecognized key: "_litellmAgentPlatform"
This causes openclaw config validate and openclaw mcp reload to fail.
I can reproduce this consistently when an MCP server is attached through the LAP Agent UI.
This appears related to the OpenClaw MCP projection logic introduced in PR #467, where LAP-provided mcp_servers are projected into OpenClaw's native mcp.servers config and bridge-owned MCP entries are tracked.
Environment
- Repository:
LiteLLM-Labs/litellm-agent-control-plane
- Runtime: OpenClaw
- OpenClaw version shown in container:
OpenClaw 2026.6.11 (e085fa1)
- MCP transport used in LAP UI:
HTTP
- Example MCP server URL:
http://<host-ip>:8765/mcp
Steps to reproduce
- Start the LAP/OpenClaw stack.
- Create or edit an Agent using the OpenClaw runtime.
- Attach an MCP server in the Agent's MCP Servers section.
- Run the Agent, or trigger MCP config sync.
- Inspect
/data/.openclaw/openclaw.json inside the OpenClaw container.
- Run:
openclaw config validate
openclaw mcp reload
Actual behavior
openclaw.json contains LAP-specific metadata like this:
{
"_litellmAgentPlatform": {
"managedMcpServers": [
"mcp_xxx"
]
},
"mcp": {
"servers": {
"mcp_xxx": {
"_litellmAgentPlatform": {
"managedBy": "litellm-agent-platform"
},
"transport": "streamable-http",
"url": "http://<host-ip>:8765/mcp"
}
}
}
}
Then OpenClaw validation fails:
Invalid config at /data/.openclaw/openclaw.json:
- <root>: Unrecognized key: "_litellmAgentPlatform"
The logs also show MCP reload failure:
[reload] config reload skipped (invalid config): : Unrecognized key: "_litellmAgentPlatform"
OpenClaw MCP reload failed: Command '['openclaw', 'mcp', 'reload']' returned non-zero exit status 1.
Expected behavior
LAP should be able to project MCP servers into OpenClaw's native mcp.servers config without writing schema-invalid metadata into openclaw.json.
After MCP projection, the following commands should still pass:
openclaw config validate
openclaw mcp reload
Validation performed
I verified this inside the OpenClaw container with:
openclaw config validate
openclaw mcp reload
Both fail after _litellmAgentPlatform is written into /data/.openclaw/openclaw.json.
After manually removing _litellmAgentPlatform from the config, openclaw config validate passes again.
Possible root cause
The bridge appears to store LAP-specific tracking metadata directly inside OpenClaw's native config file:
This metadata is useful for tracking LAP-managed MCP entries, but OpenClaw's config schema does not accept it.
As a result, the config file written by the LAP bridge is no longer valid from OpenClaw's point of view.
Suggested fix
Store LAP bridge metadata outside openclaw.json, for example in:
- LAP database
- a sidecar state file
- runtime-local metadata not consumed by OpenClaw config validation
Alternatively, strip all bridge-only metadata before writing /data/.openclaw/openclaw.json.
The final openclaw.json written to disk should contain only keys accepted by OpenClaw's config schema.
Workaround
Do not attach MCP servers through the LAP Agent UI.
Instead:
- Manually configure the MCP server in OpenClaw's native
mcp.servers.
- Do not select the MCP server in the LAP Agent MCP Servers section.
- Remove
_litellmAgentPlatform from /data/.openclaw/openclaw.json.
- Run:
openclaw config validate
openclaw mcp reload
After removing the metadata, OpenClaw config validation passes again.
Summary
When attaching an MCP server to an OpenClaw-backed LAP agent, the OpenClaw bridge writes
_litellmAgentPlatformmetadata into/data/.openclaw/openclaw.json.However, OpenClaw config validation rejects this unknown key:
This causes
openclaw config validateandopenclaw mcp reloadto fail.I can reproduce this consistently when an MCP server is attached through the LAP Agent UI.
This appears related to the OpenClaw MCP projection logic introduced in PR #467, where LAP-provided
mcp_serversare projected into OpenClaw's nativemcp.serversconfig and bridge-owned MCP entries are tracked.Environment
LiteLLM-Labs/litellm-agent-control-planeHTTPSteps to reproduce
/data/.openclaw/openclaw.jsoninside the OpenClaw container.Actual behavior
openclaw.jsoncontains LAP-specific metadata like this:{ "_litellmAgentPlatform": { "managedMcpServers": [ "mcp_xxx" ] }, "mcp": { "servers": { "mcp_xxx": { "_litellmAgentPlatform": { "managedBy": "litellm-agent-platform" }, "transport": "streamable-http", "url": "http://<host-ip>:8765/mcp" } } } }Then OpenClaw validation fails:
The logs also show MCP reload failure:
Expected behavior
LAP should be able to project MCP servers into OpenClaw's native
mcp.serversconfig without writing schema-invalid metadata intoopenclaw.json.After MCP projection, the following commands should still pass:
Validation performed
I verified this inside the OpenClaw container with:
Both fail after
_litellmAgentPlatformis written into/data/.openclaw/openclaw.json.After manually removing
_litellmAgentPlatformfrom the config,openclaw config validatepasses again.Possible root cause
The bridge appears to store LAP-specific tracking metadata directly inside OpenClaw's native config file:
This metadata is useful for tracking LAP-managed MCP entries, but OpenClaw's config schema does not accept it.
As a result, the config file written by the LAP bridge is no longer valid from OpenClaw's point of view.
Suggested fix
Store LAP bridge metadata outside
openclaw.json, for example in:Alternatively, strip all bridge-only metadata before writing
/data/.openclaw/openclaw.json.The final
openclaw.jsonwritten to disk should contain only keys accepted by OpenClaw's config schema.Workaround
Do not attach MCP servers through the LAP Agent UI.
Instead:
mcp.servers._litellmAgentPlatformfrom/data/.openclaw/openclaw.json.After removing the metadata, OpenClaw config validation passes again.