Skip to content

feat(mcp): add company management tools to MCP server - #38

Merged
Rishavraaj merged 2 commits into
feat/mcp-deal-toolsfrom
feat/mcp-company-tools
Sep 15, 2026
Merged

Rishavraaj merged 2 commits into
feat/mcp-deal-toolsfrom
feat/mcp-company-tools

Conversation

@anujeet98

@anujeet98 anujeet98 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds list_companies, get_company, create_company, update_company MCP 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 the McpDeps service-injection pattern introduced there).
  • Reads go prisma-direct for full org-scoping/ordering control; writes route through CompaniesService so validation and activity-timeline events match the REST API, tagged source: 'mcp'.
  • Adds companies:read / companies:write OAuth scopes and exports CompaniesService from SalesModule for injection into McpController.

Changes

  • Backend: apps/backend/src/app/mcp/mcp-server.ts (4 new tools), mcp.controller.ts (injects CompaniesService), apps/backend/src/app/sales/sales.module.ts (exports CompaniesService), apps/backend/src/libs/better-auth/auth.ts (new scopes)
  • Docs: docs/concepts/mcp-server.mdx — scopes table + tool reference for the 4 new tools
  • Tests: mcp-write-tools.spec.ts — 12 new tests covering scope enforcement, org resolution, and service delegation for the company tools

Test plan

  • bun nx run @zuko/backend:test — all 201 tests pass (34 in mcp-write-tools.spec.ts)
  • bun nx run @zuko/backend:build — builds clean
  • oxlint on changed files — no new warnings/errors
  • Manual: connect Claude Desktop/Code to /api/mcp, exercise list/get/create/update company via chat, confirm activity timeline shows source: mcp events
image

🤖 Generated with Claude Code

anujeet98 and others added 2 commits September 15, 2026 20:04
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>
@Rishavraaj
Rishavraaj merged commit a7bbf95 into feat/mcp-deal-tools Sep 15, 2026
1 check passed
@Rishavraaj
Rishavraaj deleted the feat/mcp-company-tools branch September 15, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants