feat(mcp): add create_context_repos and create_skills tools#227
Open
anirudhagarwal-atlan wants to merge 1 commit into
Open
feat(mcp): add create_context_repos and create_skills tools#227anirudhagarwal-atlan wants to merge 1 commit into
anirudhagarwal-atlan wants to merge 1 commit into
Conversation
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>
| "txt": "text/plain", | ||
| } | ||
|
|
||
| ARTIFACT_KIND_BY_EXT = {"md", "yaml", "json", "sql", "csv", "py"} |
There was a problem hiding this comment.
🟡 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"} |
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: aContextRepository+ a pairedcontextOutputSkill(skillType=CONTEXT_REPO) + the bundled files persisted asSkillArtifacts. Each file is uploaded to object storage via a presigned URL (POST /api/service/files/presignedUrl→ S3 PUT) and stored on the artifact'sdescriptionfor inline preview. Repo + skill are created atomically via/api/meta/entity/bulkwith cross-referencing negative guids so thecontextOutputSkillrelationship is set in a single round-trip. Optionalactivateflag flips the lifecycle to ACTIVE +certificateStatusto 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
modelcontextprotocol/tools/context_repo.pymodelcontextprotocol/tools/models.pyContextRepositorySpec,ContextBundleArtifactSpec,ContextInputAssetRef,SkillSpec.modelcontextprotocol/tools/__init__.pymodelcontextprotocol/server.pycreate_context_repos+create_skillsas MCP tools.modelcontextprotocol/pyproject.tomlpyatlan>=9.4.1(needed for the new typedefs).CLAUDE.md,modelcontextprotocol/README.mdsearch_assets_tool.Test plan
create_context_reposwithartifacts=[soul.md, skills/refunds/SKILL.md, semantic_models/orders.yaml]on a real tenant — repo + paired Skill + all 3 SkillArtifacts persisted./context-studio-app/api/context-repos/{repo_id}/artifacts/{artifact_guid}/content) returns the actual file bytes for every artifact.contextOutputSkillrelationship is materialized on the catalog ContextRepository.skills/refunds/SKILL.md) render as folders in the UI file tree.create_skillsfor a standalone CUSTOM skill.displayNamereuses its qualifiedName instead of duplicating.activate=Truepath — flips lifecycle to ACTIVE + VERIFIED.🤖 Generated with Claude Code