Thirty new tools (54 in all) for what the API gained since the MCP: create a project and read its public showcase; sprints (list, progress and burndown, plan, change, start, close with carry-over, delete, move a ticket in or out); epics and the backlog (list epics with progress, set a ticket's parent, rank); bulk edit of up to 100 tickets by key, saying which refused; the trash; checklists; following a ticket, removing a relation, editing and deleting comments; editing and archiving releases, drafting and saving their notes; notifications. Searching filters by epic, sprint and dates and sorts by backlog order; get_issue shows parent, checklist, commits and followers; create and update take parent and start date. API: `unreadOnly` and `dryRun` were documented as objects in the OpenAPI; they are booleans now. Chapter 9 lists every tool; Word and PDF regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64 lines
2.5 KiB
TypeScript
64 lines
2.5 KiB
TypeScript
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { McpModule } from '@nestjs-mcp/server';
|
|
import { TASKSTREAM_API_URL, TaskStreamApi } from './api/taskstream-api';
|
|
import { HealthController } from './health.controller';
|
|
import { McpHostsMiddleware } from './mcp-hosts.middleware';
|
|
import { BacklogResolver } from './tools/backlog.resolver';
|
|
import { IssuesResolver } from './tools/issues.resolver';
|
|
import { NotificationsResolver } from './tools/notifications.resolver';
|
|
import { ProjectsResolver } from './tools/projects.resolver';
|
|
import { ReleasesResolver } from './tools/releases.resolver';
|
|
import { SprintsResolver } from './tools/sprints.resolver';
|
|
import { UsersResolver } from './tools/users.resolver';
|
|
|
|
const INSTRUCTIONS = `TaskStream: issue tracker (projects, tickets, epics, sprints, QA, releases).
|
|
Projects and tickets go by key (WEB, WEB-12). Statuses, ticket types and areas are per
|
|
project: read their ids with get_project before creating, updating or moving tickets, and
|
|
use a ticket's allowedTransitions (get_issue) to move it. Sprints and releases go by id
|
|
(list_sprints, list_releases); the backlog is search_issues with noSprint and sort RANK.
|
|
Tools act as the user whose Pireon token the client sends; without one, only public
|
|
projects can be read.`;
|
|
|
|
@Module({
|
|
imports: [
|
|
ConfigModule.forRoot({ isGlobal: true }),
|
|
McpModule.forRootAsync({
|
|
inject: [ConfigService],
|
|
useFactory: (config: ConfigService) => ({
|
|
name: 'taskstream',
|
|
version: '1.0.0',
|
|
instructions: INSTRUCTIONS,
|
|
// The library logs every tool on every request (it builds a server per call):
|
|
// only warnings and errors unless asked for more.
|
|
logging: { level: config.get('MCP_LOG_LEVEL', 'warn') },
|
|
}),
|
|
}),
|
|
],
|
|
controllers: [HealthController],
|
|
providers: [
|
|
{
|
|
provide: TASKSTREAM_API_URL,
|
|
inject: [ConfigService],
|
|
// Origin of the API (its routes already start with /api).
|
|
useFactory: (config: ConfigService) =>
|
|
config
|
|
.get<string>('TASKSTREAM_API_URL', 'http://localhost:3000')
|
|
.replace(/\/+$/, ''),
|
|
},
|
|
TaskStreamApi,
|
|
ProjectsResolver,
|
|
IssuesResolver,
|
|
BacklogResolver,
|
|
SprintsResolver,
|
|
ReleasesResolver,
|
|
NotificationsResolver,
|
|
UsersResolver,
|
|
],
|
|
})
|
|
export class AppModule implements NestModule {
|
|
configure(consumer: MiddlewareConsumer): void {
|
|
consumer.apply(McpHostsMiddleware).forRoutes('mcp');
|
|
}
|
|
}
|