feat(mcp): add company management tools to MCP server - #38
Merged
Merged
Conversation
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>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
5 tasks
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_companies,get_company,create_company,update_companyMCP tools, mirroring the deal tools added in feat(mcp): add deal management tools to MCP server #36 (this PR is stacked on that branch since it reuses theMcpDepsservice-injection pattern introduced there).CompaniesServiceso validation and activity-timeline events match the REST API, taggedsource: 'mcp'.companies:read/companies:writeOAuth scopes and exportsCompaniesServicefromSalesModulefor injection intoMcpController.Changes
apps/backend/src/app/mcp/mcp-server.ts(4 new tools),mcp.controller.ts(injectsCompaniesService),apps/backend/src/app/sales/sales.module.ts(exportsCompaniesService),apps/backend/src/libs/better-auth/auth.ts(new scopes)docs/concepts/mcp-server.mdx— scopes table + tool reference for the 4 new toolsmcp-write-tools.spec.ts— 12 new tests covering scope enforcement, org resolution, and service delegation for the company toolsTest plan
bun nx run @zuko/backend:test— all 201 tests pass (34 inmcp-write-tools.spec.ts)bun nx run @zuko/backend:build— builds cleanoxlinton changed files — no new warnings/errors/api/mcp, exercise list/get/create/update company via chat, confirm activity timeline showssource: mcpevents🤖 Generated with Claude Code