Skip to content

feat(mcp): write operations for the MCP server (comments, votes, reactions, questions, answers) #1679

Description

@fenbox

Is your feature request related to a problem? Please describe

The built-in MCP server currently exposes read-only tools (get_questions, get_answers_by_question_id, get_comments, get_tags, get_tag_detail, get_user, plus semantic_search per #1674). An AI agent can read the knowledge base but cannot participate in it — it cannot add a comment when it finds a question unclear, cannot answer on behalf of a user who is away, and cannot record the outcome of a conversation back into the site.

This proposal defines a set of MCP write tools so agents can act on a site through the standard MCP protocol, with the same permission, rate-limit, and moderation rules as the web UI.

Identity prerequisite: write tools require per-user identity. #1555 (personal access tokens for AI agents) covers this and should land first; MCP write tools authenticate through that mechanism. The current site-level API key (read-only/global scopes) can remain for read-only tools, but write tools should be rejected for non-user-bound keys initially.

Describe the solution you'd like

Expose the following write tools. Each maps to an Admin MCP configuration switch so instance owners decide what to expose (today there is only a single Enabled toggle).

Tool Purpose Parameters
add_comment Add a comment to a question or answer object_id, content, reply_to_comment_id?
vote_up / vote_down Vote on a question or answer, subject to existing reputation and rate limits object_id, object_type (question/answer)
add_or_remove_reaction Add or remove an emoji reaction (activate/deactivate), reusing metaService.AddOrUpdateReaction object_id, object_type, emoji, action
get_reactions List a site's available emojis and a target object's current reaction summary, so agents can look before they act object_id
ask_question Create a question title, content (Markdown), tags, dry_run?
post_answer Answer a question question_id, content, dry_run?
update_question / update_answer Edit the caller's own content, preserving existing version history id, title?/content?, edit_summary?
accept_answer Accept an answer; only available when the authenticated identity is the question's author, reusing the existing AcceptAnswer validation (including self-answer restrictions) question_id, answer_id

Design notes:

  • Search-before-write: ask_question should prompt agents (in the tool description) to call get_questions first; the handler should also run a similarity check and, on a likely duplicate, return the existing question link so the agent can decide whether to proceed.
  • dry_run parameter: validates the payload and returns what would happen (format validation results, whether tags would be auto-created, which moderation rules would trigger) without persisting anything. This lets agents self-correct before committing.
  • Structured returns: responses include id, url, and moderation status (e.g. pending/published) so agents can report outcomes to users.
  • Admin configuration: extend the MCP config with a writable toggle plus per-tool switches; expose the enabled capability list so clients can discover what is allowed.

Explicitly out of scope

  • User administration (bans, permission changes), site configuration, and plugin management — these remain admin-API-only.
  • Content deletion (remove_question / remove_answer / remove_comment) and status changes (close_question / reopen_question) — deletion and moderation are deliberately excluded from MCP; agents that need to clean up after themselves should direct users to the web UI. This keeps every MCP write operation additive and reversible in spirit.
  • Bulk/import endpoints — agents can loop over single-item tools; no high-leverage atomic bulk operations over MCP.

Activity

  1. added
    new-feature
    on Nov 19, 2026
  2. added theissue type on Nov 19, 2026
  3. malikrehanmulla1048 commented on Nov 25, 2026

    @malikrehanmulla1048

    Hi @fenbox, I'd love to work on this issue!

    Since the write operations depend on per-user identity from #1555, should I wait for #1555 to land first, or is there a specific interface/mock approach I can build against in the meantime?

    Also, a quick question on scoping:

    • Would you prefer this delivered in a single PR or split into smaller PRs (e.g., admin config + comments/reactions first, followed by questions/answers/voting)?

    Let me know if it's okay to assign this to me—happy to get started!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions