Conversation
anujeet98
force-pushed
the
feat/mcp-deal-tools
branch
2 times, most recently
from
September 15, 2026 12:36
310d55f to
a3d052d
Compare
Adds list_deals, get_deal, create_deal, and update_deal tools, gated behind new deals:read/deals:write scopes. Reads go prisma-direct; writes route through DealsService so validation and deal activity-timeline events fire, tagged with a new 'mcp' activity source. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rfj8fStgnMGjHZdLX8YAsj
anujeet98
force-pushed
the
feat/mcp-deal-tools
branch
from
September 15, 2026 12:54
a3d052d to
2d49dcb
Compare
Adds list_companies, get_company, create_company, and update_company tools following the same pattern as the deal tools: reads go prisma-direct for full control of scoping/ordering, writes route through CompaniesService so validation and activity-timeline events match the REST API, tagged with source: 'mcp'. Adds companies:read/companies:write scopes and exports CompaniesService from SalesModule for injection into McpController. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4 tasks
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds a full-replace update_company_summary MCP tool for the company detail page's rich-text summary (Editor.js), routed through CompaniesService like the other write tools so it's tagged source: 'mcp'. Block-level operations (edit/append a single block without resending the whole document) are a planned follow-up. Also fixes a latent bug in CompaniesService.update's activity-diff loop: it compared object-valued fields with String(), which always produces "[object Object]" — so summary (and custom `fields`) edits never emitted a field_update activity event, via REST or MCP. Replaced with a new jsonEqual helper (libs/sales/src/lib/utils/json-equal.ts) that does an order-independent structural compare, since Postgres jsonb does not preserve object key order on round-trip and a naive JSON.stringify compare would produce false-positive diffs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
feat(mcp): add company management tools to MCP server
feat(mcp): add update_company_summary tool for Editor.js summaries
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
list_deals,get_deal,create_deal, andupdate_dealtools to the OAuth MCP serverdeals:read/deals:writescopes inMCP_SCOPESDealsService(not prisma-direct) so validation and deal activity-timeline events fire, tagged with a newmcpactivity sourceChanges by layer
mcp-server.ts(new tools),mcp.controller.ts/mcp.module.ts(wireDealsServiceinto the MCP server),sales.module.ts(exportDealsService),better-auth/auth.ts(new scopes)deal-events.ts(ACTIVITY_SOURCES.MCP),deal-activity.listener.ts(accept genericActivitySourceinstead of hardcoded'ai')docs/concepts/mcp-server.mdx— scope table and tool reference for the four new toolsTest plan
npx nx test backendpasses (mcp-write-tools.spec.tscovers create/update deal)list_deals→create_deal→update_dealmcp-sourced events after a create/update via MCP🤖 Generated with Claude Code
Manual Test screenshot (mcp connector for claude)

https://claude.ai/code/session_01Rfj8fStgnMGjHZdLX8YAsj