@agentblueprint/mcp-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +59 -0
  2. package/dist/__tests__/client.test.d.ts +1 -0
  3. package/dist/__tests__/client.test.js +99 -0
  4. package/dist/__tests__/client.test.js.map +1 -0
  5. package/dist/__tests__/config.test.d.ts +1 -0
  6. package/dist/__tests__/config.test.js +37 -0
  7. package/dist/__tests__/config.test.js.map +1 -0
  8. package/dist/__tests__/tools.test.d.ts +1 -0
  9. package/dist/__tests__/tools.test.js +83 -0
  10. package/dist/__tests__/tools.test.js.map +1 -0
  11. package/dist/client.d.ts +78 -0
  12. package/dist/client.js +48 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/config.d.ts +5 -0
  15. package/dist/config.js +9 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/errors.d.ts +5 -0
  18. package/dist/errors.js +18 -0
  19. package/dist/errors.js.map +1 -0
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.js +26 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/resources/blueprint.d.ts +14 -0
  24. package/dist/resources/blueprint.js +43 -0
  25. package/dist/resources/blueprint.js.map +1 -0
  26. package/dist/resources/blueprints.d.ts +14 -0
  27. package/dist/resources/blueprints.js +33 -0
  28. package/dist/resources/blueprints.js.map +1 -0
  29. package/dist/resources/business-profile.d.ts +14 -0
  30. package/dist/resources/business-profile.js +33 -0
  31. package/dist/resources/business-profile.js.map +1 -0
  32. package/dist/resources/spec.d.ts +14 -0
  33. package/dist/resources/spec.js +33 -0
  34. package/dist/resources/spec.js.map +1 -0
  35. package/dist/server.d.ts +3 -0
  36. package/dist/server.js +44 -0
  37. package/dist/server.js.map +1 -0
  38. package/dist/tools/get-blueprint.d.ts +30 -0
  39. package/dist/tools/get-blueprint.js +35 -0
  40. package/dist/tools/get-blueprint.js.map +1 -0
  41. package/dist/tools/get-business-case.d.ts +30 -0
  42. package/dist/tools/get-business-case.js +35 -0
  43. package/dist/tools/get-business-case.js.map +1 -0
  44. package/dist/tools/get-business-profile.d.ts +14 -0
  45. package/dist/tools/get-business-profile.js +21 -0
  46. package/dist/tools/get-business-profile.js.map +1 -0
  47. package/dist/tools/get-implementation-plan.d.ts +30 -0
  48. package/dist/tools/get-implementation-plan.js +35 -0
  49. package/dist/tools/get-implementation-plan.js.map +1 -0
  50. package/dist/tools/get-implementation-spec.d.ts +30 -0
  51. package/dist/tools/get-implementation-spec.js +35 -0
  52. package/dist/tools/get-implementation-spec.js.map +1 -0
  53. package/dist/tools/get-use-case.d.ts +30 -0
  54. package/dist/tools/get-use-case.js +35 -0
  55. package/dist/tools/get-use-case.js.map +1 -0
  56. package/dist/tools/list-blueprints.d.ts +22 -0
  57. package/dist/tools/list-blueprints.js +29 -0
  58. package/dist/tools/list-blueprints.js.map +1 -0
  59. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # @agentblueprint/mcp-server
2
+
3
+ MCP server for [Agent Blueprint](https://app.agentblueprint.ai) — gives your coding agent read access to your AI blueprints, business cases, implementation plans, and specs.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx @agentblueprint/mcp-server --token <your-api-key>
9
+ ```
10
+
11
+ ## Claude Code Setup
12
+
13
+ Add to your Claude Code MCP config (`.claude/settings.json` or project settings):
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "agent-blueprint": {
19
+ "command": "npx",
20
+ "args": ["@agentblueprint/mcp-server"],
21
+ "env": {
22
+ "AGENT_BLUEPRINT_API_KEY": "<your-api-key>"
23
+ }
24
+ }
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## Get an API Key
30
+
31
+ 1. Go to [Agent Blueprint Settings > API Tokens](https://app.agentblueprint.ai/settings/api-tokens)
32
+ 2. Click "Create Token"
33
+ 3. Copy the token (shown once)
34
+
35
+ ## Available Tools
36
+
37
+ | Tool | Description |
38
+ |------|-------------|
39
+ | `list_blueprints` | List all blueprints (summaries) |
40
+ | `get_blueprint` | Full blueprint data by ID |
41
+ | `get_business_case` | Business case for a blueprint |
42
+ | `get_implementation_plan` | Implementation plan for a blueprint |
43
+ | `get_use_case` | Use case analysis for a blueprint |
44
+ | `get_implementation_spec` | Implementation spec metadata |
45
+
46
+ ## Available Resources
47
+
48
+ | URI | Description |
49
+ |-----|-------------|
50
+ | `agentblueprint://blueprints` | Blueprint list (JSON) |
51
+ | `agentblueprint://blueprints/{id}` | Blueprint detail (Markdown) |
52
+ | `agentblueprint://blueprints/{id}/spec` | Implementation spec (Markdown) |
53
+
54
+ ## Environment Variables
55
+
56
+ | Variable | Required | Default | Description |
57
+ |----------|----------|---------|-------------|
58
+ | `AGENT_BLUEPRINT_API_KEY` | Yes | — | Your API token |
59
+ | `AGENT_BLUEPRINT_API_URL` | No | `https://app.agentblueprint.ai` | API base URL |
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,99 @@
1
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
+ import { AgentBlueprintClient } from '../client.js';
3
+ import { ApiError } from '../errors.js';
4
+ const mockConfig = {
5
+ apiKey: 'ab_live_test1234567890',
6
+ apiUrl: 'https://test.agentblueprint.ai',
7
+ };
8
+ describe('AgentBlueprintClient', () => {
9
+ let client;
10
+ beforeEach(() => {
11
+ client = new AgentBlueprintClient(mockConfig);
12
+ vi.restoreAllMocks();
13
+ });
14
+ it('getBusinessProfile calls correct endpoint', async () => {
15
+ const profileData = { id: 'prof-1', companyName: 'Acme Corp', industry: 'Technology' };
16
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
17
+ ok: true,
18
+ json: () => Promise.resolve({ success: true, data: profileData, timestamp: '' }),
19
+ }));
20
+ const result = await client.getBusinessProfile();
21
+ expect(result).toEqual(profileData);
22
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/business-profile', expect.objectContaining({
23
+ headers: expect.objectContaining({
24
+ 'Authorization': 'Bearer ab_live_test1234567890',
25
+ }),
26
+ }));
27
+ });
28
+ it('listBlueprints sends correct request', async () => {
29
+ const mockData = [
30
+ { id: 'bp-1', title: 'Test BP', version: 1, platform: 'general', agentCount: 2 },
31
+ ];
32
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
33
+ ok: true,
34
+ json: () => Promise.resolve({ success: true, data: mockData, timestamp: new Date().toISOString() }),
35
+ }));
36
+ const result = await client.listBlueprints();
37
+ expect(result).toEqual(mockData);
38
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/blueprints', expect.objectContaining({
39
+ headers: expect.objectContaining({
40
+ 'Authorization': 'Bearer ab_live_test1234567890',
41
+ }),
42
+ }));
43
+ });
44
+ it('getBlueprint encodes ID in URL', async () => {
45
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
46
+ ok: true,
47
+ json: () => Promise.resolve({ success: true, data: { id: 'bp-1' }, timestamp: '' }),
48
+ }));
49
+ await client.getBlueprint('bp-1');
50
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/blueprints/bp-1', expect.anything());
51
+ });
52
+ it('throws ApiError on non-ok response', async () => {
53
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
54
+ ok: false,
55
+ status: 401,
56
+ statusText: 'Unauthorized',
57
+ json: () => Promise.resolve({ error: 'Invalid token' }),
58
+ }));
59
+ await expect(client.listBlueprints()).rejects.toThrow(ApiError);
60
+ await expect(client.listBlueprints()).rejects.toThrow('Invalid token');
61
+ });
62
+ it('getBusinessCase calls correct endpoint', async () => {
63
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
64
+ ok: true,
65
+ json: () => Promise.resolve({ success: true, data: { id: 'bc-1' }, timestamp: '' }),
66
+ }));
67
+ await client.getBusinessCase('bp-1');
68
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/blueprints/bp-1/business-case', expect.anything());
69
+ });
70
+ it('getImplementationPlan calls correct endpoint', async () => {
71
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
72
+ ok: true,
73
+ json: () => Promise.resolve({ success: true, data: { id: 'ip-1' }, timestamp: '' }),
74
+ }));
75
+ await client.getImplementationPlan('bp-1');
76
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/blueprints/bp-1/implementation-plan', expect.anything());
77
+ });
78
+ it('getUseCase calls correct endpoint', async () => {
79
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
80
+ ok: true,
81
+ json: () => Promise.resolve({ success: true, data: { id: 'uc-1' }, timestamp: '' }),
82
+ }));
83
+ await client.getUseCase('bp-1');
84
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/blueprints/bp-1/use-case', expect.anything());
85
+ });
86
+ it('getImplementationSpec calls correct endpoint', async () => {
87
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
88
+ ok: true,
89
+ json: () => Promise.resolve({
90
+ success: true,
91
+ data: { blueprintId: 'bp-1', filename: 'test.zip', metadata: {} },
92
+ timestamp: '',
93
+ }),
94
+ }));
95
+ await client.getImplementationSpec('bp-1');
96
+ expect(fetch).toHaveBeenCalledWith('https://test.agentblueprint.ai/api/v1/blueprints/bp-1/implementation-spec', expect.anything());
97
+ });
98
+ });
99
+ //# sourceMappingURL=client.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.test.js","sourceRoot":"","sources":["../../src/__tests__/client.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,wBAAwB;IAChC,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,QAAQ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AE,EAAE,EAAE;gBACjE,SAAS,EAAE,EAAE;aACd,CAAC;SACH,CAAC,CAAC,CAAC;QAEJ,MAAM,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAE3C,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAChC,2EAA2E,EAC3E,MAAM,CAAC,QAAQ,EAAE,CAClB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
+ import { loadConfig } from '../config.js';
3
+ describe('loadConfig', () => {
4
+ const originalEnv = { ...process.env };
5
+ beforeEach(() => {
6
+ vi.unstubAllEnvs();
7
+ });
8
+ afterEach(() => {
9
+ process.env = { ...originalEnv };
10
+ });
11
+ it('loads API key from token override', () => {
12
+ const config = loadConfig('ab_live_test123');
13
+ expect(config.apiKey).toBe('ab_live_test123');
14
+ expect(config.apiUrl).toBe('https://app.agentblueprint.ai');
15
+ });
16
+ it('loads API key from environment', () => {
17
+ process.env.AGENT_BLUEPRINT_API_KEY = 'ab_live_envkey';
18
+ const config = loadConfig();
19
+ expect(config.apiKey).toBe('ab_live_envkey');
20
+ });
21
+ it('uses custom API URL from environment', () => {
22
+ process.env.AGENT_BLUEPRINT_API_KEY = 'ab_live_test';
23
+ process.env.AGENT_BLUEPRINT_API_URL = 'http://localhost:3000';
24
+ const config = loadConfig();
25
+ expect(config.apiUrl).toBe('http://localhost:3000');
26
+ });
27
+ it('throws when no API key provided', () => {
28
+ delete process.env.AGENT_BLUEPRINT_API_KEY;
29
+ expect(() => loadConfig()).toThrow('Missing API key');
30
+ });
31
+ it('token override takes precedence over env', () => {
32
+ process.env.AGENT_BLUEPRINT_API_KEY = 'ab_live_env';
33
+ const config = loadConfig('ab_live_override');
34
+ expect(config.apiKey).toBe('ab_live_override');
35
+ });
36
+ });
37
+ //# sourceMappingURL=config.test.js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,GAAG,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;QAC9D,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,OAAO,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QAC3C,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,aAAa,CAAC;QACpD,MAAM,MAAM,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ import { describe, it, expect, vi, beforeEach } from 'vitest';
2
+ import { AgentBlueprintClient } from '../client.js';
3
+ import { handleListBlueprints } from '../tools/list-blueprints.js';
4
+ import { handleGetBlueprint } from '../tools/get-blueprint.js';
5
+ import { handleGetBusinessCase } from '../tools/get-business-case.js';
6
+ import { handleGetBusinessProfile } from '../tools/get-business-profile.js';
7
+ const mockConfig = {
8
+ apiKey: 'ab_live_test',
9
+ apiUrl: 'https://test.agentblueprint.ai',
10
+ };
11
+ describe('Tool handlers', () => {
12
+ let client;
13
+ beforeEach(() => {
14
+ client = new AgentBlueprintClient(mockConfig);
15
+ vi.restoreAllMocks();
16
+ });
17
+ it('handleGetBusinessProfile returns formatted JSON', async () => {
18
+ const data = { id: 'prof-1', companyName: 'Acme Corp', industry: 'Technology' };
19
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
20
+ ok: true,
21
+ json: () => Promise.resolve({ success: true, data, timestamp: '' }),
22
+ }));
23
+ const result = await handleGetBusinessProfile(client);
24
+ expect(result.content).toHaveLength(1);
25
+ expect(result.content[0].type).toBe('text');
26
+ expect(JSON.parse(result.content[0].text)).toEqual(data);
27
+ });
28
+ it('handleGetBusinessProfile returns error on failure', async () => {
29
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
30
+ ok: false,
31
+ status: 404,
32
+ statusText: 'Not Found',
33
+ json: () => Promise.resolve({ error: 'No business profile found' }),
34
+ }));
35
+ const result = await handleGetBusinessProfile(client);
36
+ expect(result.isError).toBe(true);
37
+ expect(result.content[0].text).toContain('No business profile found');
38
+ });
39
+ it('handleListBlueprints returns formatted JSON', async () => {
40
+ const data = [{ id: 'bp-1', title: 'Test' }];
41
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
42
+ ok: true,
43
+ json: () => Promise.resolve({ success: true, data, timestamp: '' }),
44
+ }));
45
+ const result = await handleListBlueprints(client);
46
+ expect(result.content).toHaveLength(1);
47
+ expect(result.content[0].type).toBe('text');
48
+ expect(JSON.parse(result.content[0].text)).toEqual(data);
49
+ });
50
+ it('handleListBlueprints returns error on failure', async () => {
51
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
52
+ ok: false,
53
+ status: 500,
54
+ statusText: 'Internal Server Error',
55
+ json: () => Promise.resolve({ error: 'server error' }),
56
+ }));
57
+ const result = await handleListBlueprints(client);
58
+ expect(result.isError).toBe(true);
59
+ expect(result.content[0].text).toContain('server error');
60
+ });
61
+ it('handleGetBlueprint passes blueprintId correctly', async () => {
62
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
63
+ ok: true,
64
+ json: () => Promise.resolve({ success: true, data: { id: 'bp-1', data: {} }, timestamp: '' }),
65
+ }));
66
+ const result = await handleGetBlueprint(client, { blueprintId: 'bp-1' });
67
+ expect(result.content).toHaveLength(1);
68
+ const parsed = JSON.parse(result.content[0].text);
69
+ expect(parsed.id).toBe('bp-1');
70
+ });
71
+ it('handleGetBusinessCase returns business case data', async () => {
72
+ const bcData = { id: 'bc-1', data: { executiveSummary: 'Test' } };
73
+ vi.stubGlobal('fetch', vi.fn().mockResolvedValue({
74
+ ok: true,
75
+ json: () => Promise.resolve({ success: true, data: bcData, timestamp: '' }),
76
+ }));
77
+ const result = await handleGetBusinessCase(client, { blueprintId: 'bp-1' });
78
+ expect(result.content).toHaveLength(1);
79
+ const parsed = JSON.parse(result.content[0].text);
80
+ expect(parsed.data.executiveSummary).toBe('Test');
81
+ });
82
+ });
83
+ //# sourceMappingURL=tools.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.test.js","sourceRoot":"","sources":["../../src/__tests__/tools.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,gCAAgC;CACzC,CAAC;AAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,MAA4B,CAAC;IAEjC,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,GAAG,IAAI,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC9C,EAAE,CAAC,eAAe,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAA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EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,CAAC;QAClE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC;YAC/C,EAAE,EAAE,IAAI;YACR,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;SAC5E,CAAC,CAAC,CAAC;QAEJ,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;QAE5E,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,78 @@
1
+ import type { Config } from './config.js';
2
+ export interface ApiResponse<T> {
3
+ success: boolean;
4
+ data: T;
5
+ timestamp: string;
6
+ }
7
+ export declare class AgentBlueprintClient {
8
+ private config;
9
+ constructor(config: Config);
10
+ private request;
11
+ getBusinessProfile(): Promise<BusinessProfile>;
12
+ listBlueprints(): Promise<BlueprintSummary[]>;
13
+ getBlueprint(id: string): Promise<BlueprintDetail>;
14
+ getBusinessCase(blueprintId: string): Promise<ArtifactResponse>;
15
+ getImplementationPlan(blueprintId: string): Promise<ArtifactResponse>;
16
+ getUseCase(blueprintId: string): Promise<Record<string, unknown>>;
17
+ getImplementationSpec(blueprintId: string): Promise<ImplementationSpecResponse>;
18
+ }
19
+ export interface BlueprintSummary {
20
+ id: string;
21
+ title: string;
22
+ version: number;
23
+ platform: string;
24
+ agentCount: number;
25
+ lifecycleStatus: string;
26
+ useCaseId: string | null;
27
+ createdAt: string;
28
+ updatedAt: string;
29
+ }
30
+ export interface BlueprintDetail {
31
+ id: string;
32
+ version: number;
33
+ lifecycleStatus: string;
34
+ useCaseId: string | null;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ data: Record<string, unknown>;
38
+ }
39
+ export interface ArtifactResponse {
40
+ id: string;
41
+ version: number;
42
+ blueprintId: string;
43
+ createdAt: string;
44
+ updatedAt: string;
45
+ data: Record<string, unknown>;
46
+ }
47
+ export interface ImplementationSpecResponse {
48
+ blueprintId: string;
49
+ filename: string;
50
+ metadata: {
51
+ agentCount: number;
52
+ platform: string;
53
+ hasBusinessCase: boolean;
54
+ hasImplementationPlan: boolean;
55
+ hasUseCase: boolean;
56
+ referenceFileCount: number;
57
+ totalFileCount: number;
58
+ };
59
+ }
60
+ export interface BusinessProfile {
61
+ id: string;
62
+ organizationId: string;
63
+ companyName: string;
64
+ industry: string | null;
65
+ size: string | null;
66
+ revenue: string | null;
67
+ currency: string;
68
+ description: string | null;
69
+ companyWebsite: string | null;
70
+ strategicInitiatives: unknown[];
71
+ technologyProfile: Record<string, unknown> | null;
72
+ organizationalCapabilities: Record<string, unknown> | null;
73
+ businessOperations: Record<string, unknown> | null;
74
+ constraintsProfile: Record<string, unknown> | null;
75
+ aiReadinessScore: number | null;
76
+ createdAt: string;
77
+ updatedAt: string;
78
+ }
package/dist/client.js ADDED
@@ -0,0 +1,48 @@
1
+ import { ApiError } from './errors.js';
2
+ export class AgentBlueprintClient {
3
+ config;
4
+ constructor(config) {
5
+ this.config = config;
6
+ }
7
+ async request(path) {
8
+ const url = `${this.config.apiUrl}/api/v1${path}`;
9
+ const response = await fetch(url, {
10
+ method: 'GET',
11
+ headers: {
12
+ 'Authorization': `Bearer ${this.config.apiKey}`,
13
+ 'Accept': 'application/json',
14
+ },
15
+ });
16
+ if (!response.ok) {
17
+ const body = await response.json().catch(() => ({ error: response.statusText }));
18
+ throw new ApiError(response.status, body.error || `Request failed: ${response.status}`);
19
+ }
20
+ const json = (await response.json());
21
+ if (!json.success) {
22
+ throw new ApiError(400, 'API returned unsuccessful response');
23
+ }
24
+ return json.data;
25
+ }
26
+ async getBusinessProfile() {
27
+ return this.request('/business-profile');
28
+ }
29
+ async listBlueprints() {
30
+ return this.request('/blueprints');
31
+ }
32
+ async getBlueprint(id) {
33
+ return this.request(`/blueprints/${encodeURIComponent(id)}`);
34
+ }
35
+ async getBusinessCase(blueprintId) {
36
+ return this.request(`/blueprints/${encodeURIComponent(blueprintId)}/business-case`);
37
+ }
38
+ async getImplementationPlan(blueprintId) {
39
+ return this.request(`/blueprints/${encodeURIComponent(blueprintId)}/implementation-plan`);
40
+ }
41
+ async getUseCase(blueprintId) {
42
+ return this.request(`/blueprints/${encodeURIComponent(blueprintId)}/use-case`);
43
+ }
44
+ async getImplementationSpec(blueprintId) {
45
+ return this.request(`/blueprints/${encodeURIComponent(blueprintId)}/implementation-spec`);
46
+ }
47
+ }
48
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC,MAAM,OAAO,oBAAoB;IACvB,MAAM,CAAS;IAEvB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,OAAO,CAAI,IAAY;QACnC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,UAAU,IAAI,EAAE,CAAC;QAClD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,eAAe,EAAE,UAAU,IAAI,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,WAAW,CAAC,sBAAsB,CACrE,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAmB;QAClC,OAAO,IAAI,CAAC,OAAO,CACjB,eAAe,kBAAkB,CAAC,WAAW,CAAC,WAAW,CAC1D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,WAAmB;QAC7C,OAAO,IAAI,CAAC,OAAO,CACjB,eAAe,kBAAkB,CAAC,WAAW,CAAC,sBAAsB,CACrE,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export interface Config {
2
+ apiKey: string;
3
+ apiUrl: string;
4
+ }
5
+ export declare function loadConfig(tokenOverride?: string): Config;
package/dist/config.js ADDED
@@ -0,0 +1,9 @@
1
+ export function loadConfig(tokenOverride) {
2
+ const apiKey = tokenOverride || process.env.AGENT_BLUEPRINT_API_KEY || '';
3
+ const apiUrl = process.env.AGENT_BLUEPRINT_API_URL || 'https://app.agentblueprint.ai';
4
+ if (!apiKey) {
5
+ throw new Error('Missing API key. Set AGENT_BLUEPRINT_API_KEY environment variable or pass --token flag.');
6
+ }
7
+ return { apiKey, apiUrl };
8
+ }
9
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,UAAU,CAAC,aAAsB;IAC/C,MAAM,MAAM,GAAG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,EAAE,CAAC;IAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,+BAA+B,CAAC;IAEtF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare class ApiError extends Error {
2
+ readonly statusCode: number;
3
+ constructor(statusCode: number, message: string);
4
+ }
5
+ export declare function formatError(err: unknown): string;
package/dist/errors.js ADDED
@@ -0,0 +1,18 @@
1
+ export class ApiError extends Error {
2
+ statusCode;
3
+ constructor(statusCode, message) {
4
+ super(message);
5
+ this.statusCode = statusCode;
6
+ this.name = 'ApiError';
7
+ }
8
+ }
9
+ export function formatError(err) {
10
+ if (err instanceof ApiError) {
11
+ return `API error (${err.statusCode}): ${err.message}`;
12
+ }
13
+ if (err instanceof Error) {
14
+ return err.message;
15
+ }
16
+ return String(err);
17
+ }
18
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEf;IADlB,YACkB,UAAkB,EAClC,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,eAAU,GAAV,UAAU,CAAQ;QAIlC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAC5B,OAAO,cAAc,GAAG,CAAC,UAAU,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;IACD,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { loadConfig } from './config.js';
4
+ import { createServer } from './server.js';
5
+ function parseArgs(args) {
6
+ const tokenIdx = args.indexOf('--token');
7
+ if (tokenIdx !== -1 && args[tokenIdx + 1]) {
8
+ return { token: args[tokenIdx + 1] };
9
+ }
10
+ return {};
11
+ }
12
+ async function main() {
13
+ const { token } = parseArgs(process.argv.slice(2));
14
+ try {
15
+ const config = loadConfig(token);
16
+ const server = createServer(config);
17
+ const transport = new StdioServerTransport();
18
+ await server.connect(transport);
19
+ }
20
+ catch (err) {
21
+ console.error(err.message);
22
+ process.exit(1);
23
+ }
24
+ }
25
+ main();
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { AgentBlueprintClient } from '../client.js';
2
+ export declare const blueprintResourceTemplate: {
3
+ uriTemplate: string;
4
+ name: string;
5
+ description: string;
6
+ mimeType: string;
7
+ };
8
+ export declare function readBlueprint(client: AgentBlueprintClient, id: string): Promise<{
9
+ contents: {
10
+ uri: string;
11
+ mimeType: string;
12
+ text: string;
13
+ }[];
14
+ }>;
@@ -0,0 +1,43 @@
1
+ import { formatError } from '../errors.js';
2
+ export const blueprintResourceTemplate = {
3
+ uriTemplate: 'agentblueprint://blueprints/{id}',
4
+ name: 'Blueprint Detail',
5
+ description: 'Full blueprint data as markdown summary',
6
+ mimeType: 'text/markdown',
7
+ };
8
+ export async function readBlueprint(client, id) {
9
+ const uri = `agentblueprint://blueprints/${id}`;
10
+ try {
11
+ const bp = await client.getBlueprint(id);
12
+ const data = bp.data;
13
+ const team = (data.enhancedDigitalTeam ?? data.digitalTeam ?? []);
14
+ let md = `# ${data.blueprintTitle ?? data.title ?? 'Blueprint'}\n\n`;
15
+ md += `**ID:** ${bp.id}\n`;
16
+ md += `**Version:** ${bp.version}\n`;
17
+ md += `**Status:** ${bp.lifecycleStatus}\n`;
18
+ md += `**Updated:** ${bp.updatedAt}\n\n`;
19
+ if (team.length > 0) {
20
+ md += `## Agents (${team.length})\n\n`;
21
+ for (const agent of team) {
22
+ md += `### ${agent.name ?? 'Unnamed Agent'}\n`;
23
+ if (agent.role)
24
+ md += `**Role:** ${agent.role}\n`;
25
+ if (agent.description)
26
+ md += `${agent.description}\n`;
27
+ md += '\n';
28
+ }
29
+ }
30
+ if (data.executiveSummary) {
31
+ md += `## Executive Summary\n\n${data.executiveSummary}\n\n`;
32
+ }
33
+ return {
34
+ contents: [{ uri, mimeType: 'text/markdown', text: md }],
35
+ };
36
+ }
37
+ catch (err) {
38
+ return {
39
+ contents: [{ uri, mimeType: 'text/plain', text: `Error: ${formatError(err)}` }],
40
+ };
41
+ }
42
+ }
43
+ //# sourceMappingURL=blueprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blueprint.js","sourceRoot":"","sources":["../../src/resources/blueprint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,WAAW,EAAE,kCAAkC;IAC/C,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,eAAe;CAC1B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAA4B,EAAE,EAAU;IAC1E,MAAM,GAAG,GAAG,+BAA+B,EAAE,EAAE,CAAC;IAChD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,EAAE,CAAC,IAA+B,CAAC;QAChD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,mBAAmB,IAAI,IAAI,CAAC,WAAW,IAAI,EAAE,CAAmC,CAAC;QAEpG,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,IAAI,WAAW,MAAM,CAAC;QACrE,EAAE,IAAI,WAAW,EAAE,CAAC,EAAE,IAAI,CAAC;QAC3B,EAAE,IAAI,gBAAgB,EAAE,CAAC,OAAO,IAAI,CAAC;QACrC,EAAE,IAAI,eAAe,EAAE,CAAC,eAAe,IAAI,CAAC;QAC5C,EAAE,IAAI,gBAAgB,EAAE,CAAC,SAAS,MAAM,CAAC;QAEzC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,EAAE,IAAI,cAAc,IAAI,CAAC,MAAM,OAAO,CAAC;YACvC,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;gBACzB,EAAE,IAAI,OAAO,KAAK,CAAC,IAAI,IAAI,eAAe,IAAI,CAAC;gBAC/C,IAAI,KAAK,CAAC,IAAI;oBAAE,EAAE,IAAI,aAAa,KAAK,CAAC,IAAI,IAAI,CAAC;gBAClD,IAAI,KAAK,CAAC,WAAW;oBAAE,EAAE,IAAI,GAAG,KAAK,CAAC,WAAW,IAAI,CAAC;gBACtD,EAAE,IAAI,IAAI,CAAC;YACb,CAAC;QACH,CAAC;QAED,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC1B,EAAE,IAAI,2BAA2B,IAAI,CAAC,gBAAgB,MAAM,CAAC;QAC/D,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;SACzD,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO;YACL,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;SAChF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { AgentBlueprintClient } from '../client.js';
2
+ export declare const blueprintListResource: {
3
+ uri: string;
4
+ name: string;
5
+ description: string;
6
+ mimeType: string;
7
+ };
8
+ export declare function readBlueprintList(client: AgentBlueprintClient): Promise<{
9
+ contents: {
10
+ uri: string;
11
+ mimeType: string;
12
+ text: string;
13
+ }[];
14
+ }>;