Skip to content

feat(materials): extract structured MCP server info from AI agent config#2904

Merged
jiparis merged 1 commit into
chainloop-dev:mainfrom
jiparis:jiparis/mcp-servers-issue
Mar 22, 2026
Merged

feat(materials): extract structured MCP server info from AI agent config#2904
jiparis merged 1 commit into
chainloop-dev:mainfrom
jiparis:jiparis/mcp-servers-issue

Conversation

@jiparis

@jiparis jiparis commented Mar 21, 2026

Copy link
Copy Markdown
Member

Summary

  • Parse .mcp.json and .claude/settings.json to populate the mcp_servers field with structured data (server name, command, args, URL, disabled status), allowing the creation of policies that evaluate used MCP services.
  • Strip environment variable values for security — only key names are retained in env_keys
  • Remove .mcp.json from raw config_files collection to prevent leaking sensitive data (API keys, tokens)
  • Add typed MCPServer struct replacing the any placeholder, with corresponding JSON schema validation
  • Extract safeReadFile helper to consolidate the symlink-resolve, path-verify, read-file sequence

Closes #2888

Parse .mcp.json and settings.json to populate the mcp_servers field with
structured data (server name, command, args, URL, transport type).
Environment variable values are stripped for security — only key names
are retained. The raw .mcp.json file is no longer collected in
config_files to prevent leaking sensitive data like API keys.

Closes chainloop-dev#2888

Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/aiagentconfig/aiagentconfig.go">

<violation number="1" location="internal/aiagentconfig/aiagentconfig.go:70">
P2: Remove `omitempty` from the `disabled` boolean so `false` is serialized explicitly.

(Based on your team's feedback about preferring explicit states over omitting boolean false values.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread internal/aiagentconfig/aiagentconfig.go
@jiparis jiparis merged commit 354edef into chainloop-dev:main Mar 22, 2026
15 checks passed
@jiparis jiparis deleted the jiparis/mcp-servers-issue branch March 22, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add structured MCP server discovery to CHAINLOOP_AI_AGENT_CONFIG material

2 participants