Skip to content

feat(mcp): add attachment tools for work items and wiki pages - #288

Open
yakky wants to merge 2 commits into
feature/us-14050-mcp-create-custom-attributefrom
feature/issue-287-mcp-attachments
Open

yakky wants to merge 2 commits into
feature/us-14050-mcp-create-custom-attributefrom
feature/issue-287-mcp-attachments

Conversation

@yakky

@yakky yakky commented Nov 18, 2026

Copy link
Copy Markdown
Member

Description

Add four MCP tools so agents can manage attachments: add_attachment_content
(base64, 64 KB default cap), add_attachment_file, list_attachments and
delete_attachment. They work on user stories, tasks, issues, epics and wiki
pages (for wiki pages, ref is the page id and the page must belong to the
given project).

add_attachment_file reads only inside TAIGA_MCP_UPLOAD_DIR and is not
registered when the variable is unset. Paths are confined to that directory,
only regular files are accepted, the file is opened without following a final
symlink and re-verified on the open descriptor (inode and real path) before its
size is checked (25 MB default cap). delete_attachment is refused unless the
attachment belongs to the stated project and matches the expected name.
Known limits (POSIX only, the race check relies on /proc, hardlinks are
undetectable) are documented in docs/mcp.rst.

Not included: get_attachment / downloads, milestones.

References

Fix #287
Stacked on #283.

Checklist

  • I have read the contribution guide
  • Code lint checked via inv lint (ruff passes on the changed files; the repo-wide ruff hook has 102 existing findings)
  • changes file included (changes/287.feature)
  • Usage documentation added in case of new features
  • Tests added (561 pass; server.py at 100% coverage)

AI usage

Model: Claude Sonnet 5.5 (Claude Code), with Opus for reviews. Scope: design,
implementation, tests, docs and security hardening of the attachment tools,
written with a human approving each step. Prompts: add support for uploading
attachments to the MCP server; both base64 and path routes, with the path
restricted to an upload directory; add list and delete tools; fix the upload
race; add wiki pages (issue #287).

Agent usage

Stage Agent/skill Tokens Time
Design brainstorming and writing-plans, spec/plan addendum ≈30k ≈10m
Implementation subagent-driven-development (Sonnet implementers, 7 tasks) ≈600k ≈25m
Review Opus task and whole-branch reviewers ≈250k ≈10m

🤖 Generated with Claude Code

https://claude.ai/code/session_01RX2iLdY1S4Y5HKEj22MpyF

yakky and others added 2 commits November 18, 2026 09:17
Add add_attachment_content (base64, 64 KB default cap), add_attachment_file,
list_attachments and delete_attachment for user stories, tasks, issues, epics
and wiki pages (for wiki pages ref is the page id; the page must belong to the
given project). Refs #287.

add_attachment_file only reads inside TAIGA_MCP_UPLOAD_DIR and is not
registered when the variable is unset: paths are resolved and confined to the
directory, only regular files are accepted, the file is opened without
following a final symlink and re-verified on the opened descriptor, including
its real path, before its size is checked (25 MB default cap). Invalid
TAIGA_MCP_MAX_*_BYTES values fail at startup. delete_attachment is refused
unless the attachment belongs to the stated project and matches the expected
name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RX2iLdY1S4Y5HKEj22MpyF
Describe the four attachment tools (including wiki pages), the
TAIGA_MCP_UPLOAD_DIR and TAIGA_MCP_MAX_*_BYTES variables, the upload-directory
security model and its known limits (POSIX only, race protection relies on
/proc, hardlinks), and add the new write tools to the destructive-tools note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RX2iLdY1S4Y5HKEj22MpyF
@yakky yakky added the AI AI-assisted change label Nov 18, 2026
@yakky yakky self-assigned this Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.41%. Comparing base (2307b6e) to head (2985aa0).

Additional details and impacted files
@@                               Coverage Diff                                @@
##           feature/us-14050-mcp-create-custom-attribute     #288      +/-   ##
================================================================================
+ Coverage                                         98.25%   98.41%   +0.15%     
================================================================================
  Files                                                12       12              
  Lines                                              1607     1762     +155     
  Branches                                            154      174      +20     
================================================================================
+ Hits                                               1579     1734     +155     
  Misses                                               19       19              
  Partials                                              9        9              
Flag Coverage Δ
unittests 98.41% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 98.922% (+0.1%) from 98.818% — feature/issue-287-mcp-attachments into feature/us-14050-mcp-create-custom-attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI-assisted change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants