Skip to content

feat(mcp-server): runtime resource lookup + path guards (#72)#87

Merged
cobusgreyling merged 3 commits into
mainfrom
fix/pr-72-mcp-path-guards
Jun 29, 2026
Merged

feat(mcp-server): runtime resource lookup + path guards (#72)#87
cobusgreyling merged 3 commits into
mainfrom
fix/pr-72-mcp-path-guards

Conversation

@cobusgreyling

Copy link
Copy Markdown
Owner

Builds on community PR #72 by @KhaiTrang1995, rebased onto main (post-#86).

From #72

  • @cobusgreyling/loop-mcp-server — patterns, skills, state, budget, safety as MCP resources/tools
  • 22 tests, CI gate, example config at examples/mcp/loop-engineering.mcp.json

Maintainer additions (review feedback)

  • Path traversal guards — pattern IDs allowlisted via registry; state files allowlisted; reject .. / slashes
  • Discoverability — README Quick Links, primitives matrix, examples README
  • v1 install docs — repo-only until npm publish (documented in tools/mcp-server/README.md)

Verification

  • npm run test:tools ✓ (including test:mcp-server)
  • bash scripts/ci-validate-gates.sh

Supersedes #72 — thanks @KhaiTrang1995!

KhaiTrang1995 and others added 3 commits June 29, 2026 17:05
MCP server exposes loop-engineering patterns, skills, state, budget,
and safety docs as queryable resources via Model Context Protocol.
Agents can query what they need on-demand instead of prompt stuffing.

Resources: registry, config, budget, run-log, safety, patterns/{id},
skills/{name}, state/{file}

Tools: list_patterns, list_skills, list_state_files, get_pattern,
get_skill, get_state, recommend_pattern, estimate_cost

Includes 16 tests, CI gate integration, and MCP config example.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…ation tests

zod was imported in src/index.ts but only resolved transitively via
@modelcontextprotocol/sdk, so the build could break if the SDK changed
its zod range. Declare it explicitly in dependencies.

Add 4 integration tests that spawn the real server over stdio and exercise
the index.ts tool/resource handlers (tools/list, loop_list_patterns,
loop_estimate_cost, pattern resource read), complementing the existing
resolver-level unit tests. Suite now 20/20 passing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Allowlist pattern IDs via registry / patterns dir listing
- Allowlist state files; reject .. / slashes in user-supplied segments
- Add regression tests for traversal attempts
- Cross-link from README, primitives matrix, examples README
- Document repo-only v1 install in mcp-server README

Builds on community PR #72 by @KhaiTrang1995
@github-actions

Copy link
Copy Markdown
Contributor

Loop Readiness Audit

Score: 100/100 (L3)

Strong loop readiness — good candidate for L3 with explicit gates.

Top suggestions

  • Create loop-constraints.md with denylist paths, push/merge rules, and human gates (see templates/loop-constraints.md)

Posted by audit.yml · loop-audit docs

@cobusgreyling cobusgreyling merged commit f68acb5 into main Jun 29, 2026
2 checks passed
@cobusgreyling cobusgreyling deleted the fix/pr-72-mcp-path-guards branch June 29, 2026 15:06
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.

2 participants