Repository navigation
feat(mcp): create_event tool - #261
Merged
Merged
Conversation
Agents can record an event through the MCP endpoint. The tool calls the CreateEvent RPC, so event:write and the team scope apply as on the REST API, and a deployment or operation that starts locks its service. Required: title, type, service, environment, status. Defaults: priority P3, source mcp, owner the caller (user name or apikey:<prefix>), start date now. Annotated as not read-only and not destructive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Stacked on #260 (removal of the Python MCP server): merge #260 first, this PR then retargets
main.New MCP tool
create_event, so an assistant can record a deployment, operation, drift, incident or RPA usage.CreateEventRPC under its own name (rpcContext), like the read tools:event:writeand the team scope apply exactly as on the REST API, and the same side effects happen (changelog entry, automatic lock).title,type,service,environment,status. Optional:priority(defaultP3),message,source(defaultmcp),owner(default the caller: user name for a session,apikey:<prefix>for a key),start_date(default now),end_date,impact,pull_request_link,ticket,related_id.YYYY-MM-DDor RFC 3339;end_datebeforestart_dateis rejected.deploymentoroperationcreated withstart/in_progresslocks its service in its environment, and fails if it is already locked. The tool description says so, so the agent can explain the error.readOnlyHint: false,destructiveHint: false,openWorldHint: false: clients that auto-approve read-only tools will ask before creating.Docs:
docs/MCP_SERVER.md(tool table, defaults,event:writefor the MCP key, note that the transitional anonymous permissions include writing) andFEATURES.md.Checks
TestMCPCreateEventover the real auth middleware: team key creates in its scope (defaults, dates, links, readable withget_event), session user is the owner, lock taken onstart, refused when already locked, out of scope, anonymous without permission, invalid inputs (unknown type, blank title, missing status, bad date, end before start).TestMCPListsReadOnlyToolsnow expectscreate_eventas the only non read-only tool.serv:tools/listshows the annotations and the 5 required fields;create_eventcreates the event (visible inevents/today) and its lock; a second start on the same service is refused with the lock message.MONGO_TEST_URI=… go test ./..., gosec, staticcheck: OK.🤖 Generated with Claude Code