Skip to content

feat(mcp): add create_context_repos and create_skills tools#227

Open
anirudhagarwal-atlan wants to merge 1 commit into
mainfrom
feature/context-repos
Open

feat(mcp): add create_context_repos and create_skills tools#227
anirudhagarwal-atlan wants to merge 1 commit into
mainfrom
feature/context-repos

Conversation

@anirudhagarwal-atlan
Copy link
Copy Markdown

@anirudhagarwal-atlan anirudhagarwal-atlan commented May 21, 2026

Summary

Adds two new MCP tools that let Claude Code (and any other MCP client) build agentic context directly on top of Atlan:

  • create_context_repos — creates a full agent bundle in one call: a ContextRepository + a paired contextOutputSkill (skillType=CONTEXT_REPO) + the bundled files persisted as SkillArtifacts. Each file is uploaded to object storage via a presigned URL (POST /api/service/files/presignedUrl → S3 PUT) and stored on the artifact's description for inline preview. Repo + skill are created atomically via /api/meta/entity/bulk with cross-referencing negative guids so the contextOutputSkill relationship is set in a single round-trip. Optional activate flag flips the lifecycle to ACTIVE + certificateStatus to VERIFIED. Idempotent on re-publish (existing artifact qualifiedNames are reused).
  • create_skills — covers the narrower case of SYSTEM / CUSTOM skills that exist independently of any repo.

The bundle flow mirrors the canonical persistence sequence used by skills/agent-bundle/scripts/publish_to_atlan.py (paired bulk create → per-artifact entity write → S3 PUT to presigned URL), so anything created via this MCP tool renders identically to the existing Context Studio repos.

What changed

File Why
modelcontextprotocol/tools/context_repo.py New module — implements the three-stage bundle persistence + standalone Skill creation.
modelcontextprotocol/tools/models.py New Pydantic specs: ContextRepositorySpec, ContextBundleArtifactSpec, ContextInputAssetRef, SkillSpec.
modelcontextprotocol/tools/__init__.py Export the new functions + specs.
modelcontextprotocol/server.py Register create_context_repos + create_skills as MCP tools.
modelcontextprotocol/pyproject.toml Bump pyatlan>=9.4.1 (needed for the new typedefs).
CLAUDE.md, modelcontextprotocol/README.md Document the new tools and how to discover existing agentic assets via search_assets_tool.

Test plan

  • create_context_repos with artifacts=[soul.md, skills/refunds/SKILL.md, semantic_models/orders.yaml] on a real tenant — repo + paired Skill + all 3 SkillArtifacts persisted.
  • Verify the UI content endpoint (/context-studio-app/api/context-repos/{repo_id}/artifacts/{artifact_guid}/content) returns the actual file bytes for every artifact.
  • Verify contextOutputSkill relationship is materialized on the catalog ContextRepository.
  • Verify nested folder paths (e.g. skills/refunds/SKILL.md) render as folders in the UI file tree.
  • create_skills for a standalone CUSTOM skill.
  • Re-publish smoke (idempotency) — confirms the same displayName reuses its qualifiedName instead of duplicating.
  • activate=True path — flips lifecycle to ACTIVE + VERIFIED.

🤖 Generated with Claude Code


Open in Devin Review

Adds two new MCP tools for building agentic context on top of Atlan:

- `create_context_repos` creates a full bundle in one call: a
  ContextRepository + a paired contextOutputSkill (skillType=CONTEXT_REPO)
  + the bundled files persisted as SkillArtifacts. Each file is uploaded
  to object storage via a presigned URL (POST /api/service/files/presignedUrl)
  and its SkillArtifact carries the six fields the UI needs to render the
  tree (name, displayName, filePath, fileType, description,
  skillArtifactRepoGuid) plus the skillSource relationship. Repo + skill
  are created atomically via /api/meta/entity/bulk with cross-referencing
  negative guids. Optional `activate` flag flips lifecycle to ACTIVE +
  certificateStatus to VERIFIED. Idempotent on re-publish.
- `create_skills` covers the narrower case of SYSTEM / CUSTOM skills that
  exist independently of any repo.

Bumps pyatlan>=9.4.1 (needed for the ContextRepository / Skill / SkillArtifact
typedefs). Mirrors the canonical agent-bundle persistence flow used by
skills/agent-bundle/scripts/publish_to_atlan.py.

Verified end-to-end on context.atlan.com — repo, paired skill, and every
SkillArtifact render correctly in the UI file tree with their content
served by the Context Studio content endpoint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

"txt": "text/plain",
}

ARTIFACT_KIND_BY_EXT = {"md", "yaml", "json", "sql", "csv", "py"}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 yml extension missing from ARTIFACT_KIND_BY_EXT causes misclassification of .yml files

The ARTIFACT_KIND_BY_EXT set includes "yaml" but not "yml". When a user uploads a .yml file (an extremely common YAML extension), _ext_of at modelcontextprotocol/tools/context_repo.py:80 correctly returns "yml", but _kind_of("yml") at line 84 falls back to "md" because "yml" is not in the set. This results in the artifact's qualifiedName containing /artifact/md/ instead of /artifact/yml/ (or the expected yaml-related kind). Note that CONTENT_TYPE_BY_EXT at line 57 correctly maps both "yml" and "yaml", making this inconsistency clearly unintentional.

Suggested change
ARTIFACT_KIND_BY_EXT = {"md", "yaml", "json", "sql", "csv", "py"}
ARTIFACT_KIND_BY_EXT = {"md", "yaml", "yml", "json", "sql", "csv", "py"}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant