feat(operations): add create_project operation across agent, mcp, and cli (#529)

* feat(operations): add create_project operation across agent, mcp, and cli

* fix(api): remove legacy team creation endpoint

* fix(api): preserve ProjectInfo response on POST /teams/:teamId/projects
This commit is contained in:
Yiling-J
2026-11-13 11:43:08 +08:00
committed by GitHub
parent 97c2939b5e
commit c55804a548
20 changed files with 369 additions and 66 deletions
@@ -82,6 +82,34 @@ describe('MCP server and /api/ops (integration)', () => {
expect(audit).toMatchObject({ userId: owner.id, teamId, projectId, via: 'mcp' })
})
it('lets an MCP client create a project without specifying teamId and create a folder in it', async () => {
const client = await connect(ownerToken)
const createdProject = await client.callTool({
name: 'create_project',
arguments: { name: 'MCP Created Project' },
})
expect(createdProject.isError).toBeFalsy()
const created = createdProject.structuredContent as {
id: string
name: string
teamId: string
rootFolderId: string
}
expect(created).toMatchObject({
id: expect.any(String),
name: 'MCP Created Project',
teamId,
rootFolderId: expect.any(String),
})
const createdFolder = await client.callTool({
name: 'create_folder',
arguments: { parent: created.rootFolderId, name: 'Inside New Project' },
})
expect(createdFolder.isError).toBeFalsy()
})
it("enforces the token owner's permissions", async () => {
const client = await connect(reviewerToken)