@atlaskit/ads-mcp 0.2.3 → 0.2.5
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.
- package/CHANGELOG.md +13 -0
- package/package.json +3 -4
- package/build/tsconfig.json +0 -22
- package/src/index.tsx +0 -70
- package/src/instructions.tsx +0 -5
- package/src/schema.tsx +0 -19
- package/src/tools/get-component-details/index.tsx +0 -64
- package/src/tools/get-components/components.tsx +0 -3579
- package/src/tools/get-components/index.tsx +0 -36
- package/src/tools/get-icons/index.tsx +0 -49
- package/src/tools/get-tokens/index.tsx +0 -43
- package/tsconfig.app.json +0 -41
- package/tsconfig.dev.json +0 -43
- package/tsconfig.json +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/ads-mcp
|
|
2
2
|
|
|
3
|
+
## 0.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`098cfbb01dc36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/098cfbb01dc36) -
|
|
8
|
+
Add missing npmignore files to remove unnecessary files from published package
|
|
9
|
+
|
|
10
|
+
## 0.2.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 0.2.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/ads-mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "The official Atlassian Design System MCP server to develop apps and user interfaces matching the Atlassian style.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"./package.json": "./package.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/icon": "^
|
|
32
|
+
"@atlaskit/icon": "^28.0.0",
|
|
33
33
|
"@atlaskit/tokens": "^6.0.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.8.0",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"zod-to-json-schema": "^3.24.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"ts-node": "^10.9.1"
|
|
41
|
-
"typescript": "~5.4.2"
|
|
40
|
+
"ts-node": "^10.9.1"
|
|
42
41
|
}
|
|
43
42
|
}
|
package/build/tsconfig.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"paths": {}
|
|
6
|
-
},
|
|
7
|
-
"include": [
|
|
8
|
-
"../src/**/*.ts",
|
|
9
|
-
"../src/**/*.tsx"
|
|
10
|
-
],
|
|
11
|
-
"exclude": [
|
|
12
|
-
"../src/**/__tests__/*",
|
|
13
|
-
"../src/**/*.test.*",
|
|
14
|
-
"../src/**/test.*",
|
|
15
|
-
"../src/**/examples.*",
|
|
16
|
-
"../src/**/examples/*",
|
|
17
|
-
"../src/**/examples/**/*",
|
|
18
|
-
"../src/**/*.stories.*",
|
|
19
|
-
"../src/**/stories/*",
|
|
20
|
-
"../src/**/stories/**/*"
|
|
21
|
-
]
|
|
22
|
-
}
|
package/src/index.tsx
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/extensions */
|
|
2
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
-
|
|
6
|
-
import { instructions } from './instructions';
|
|
7
|
-
import {
|
|
8
|
-
getComponentDetailsTool,
|
|
9
|
-
listGetComponentDetailsTool,
|
|
10
|
-
} from './tools/get-component-details';
|
|
11
|
-
import { getComponentsTool, listGetComponentsTool } from './tools/get-components';
|
|
12
|
-
import { getIconsTool, listGetIconsTool } from './tools/get-icons';
|
|
13
|
-
import { getTokensTool, listGetTokensTool } from './tools/get-tokens';
|
|
14
|
-
|
|
15
|
-
// eslint-disable-next-line import/no-extraneous-dependencies -- this uses require because not all node versions this package supports use the same import assertions/attributes
|
|
16
|
-
const pkgJson = require('@atlaskit/ads-mcp/package.json');
|
|
17
|
-
|
|
18
|
-
const server = new Server(
|
|
19
|
-
{
|
|
20
|
-
name: pkgJson.name || '@atlaskit/ads-mcp',
|
|
21
|
-
version: pkgJson.version || '0.0.0-unknown',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
instructions,
|
|
25
|
-
capabilities: {
|
|
26
|
-
// Tools are defined in the handlers below.
|
|
27
|
-
tools: {},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
33
|
-
return {
|
|
34
|
-
tools: [
|
|
35
|
-
listGetTokensTool,
|
|
36
|
-
listGetComponentsTool,
|
|
37
|
-
listGetComponentDetailsTool,
|
|
38
|
-
listGetIconsTool,
|
|
39
|
-
],
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
const callTools: Record<string, (params: any) => Promise<any>> = {
|
|
44
|
-
get_tokens: getTokensTool,
|
|
45
|
-
get_components: getComponentsTool,
|
|
46
|
-
get_component_details: getComponentDetailsTool,
|
|
47
|
-
get_icons: getIconsTool,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// Handle tool execution
|
|
51
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
52
|
-
const tool = callTools[request.params.name];
|
|
53
|
-
|
|
54
|
-
if (tool) {
|
|
55
|
-
return tool(request.params.arguments);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
throw new Error(
|
|
59
|
-
`Tool '${request.params.name}' not found, only the following tools are available: ${Object.keys(callTools).join(', ')}`,
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
async function runServer() {
|
|
64
|
-
const transport = new StdioServerTransport();
|
|
65
|
-
await server.connect(transport);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
runServer().catch((error) => {
|
|
69
|
-
throw new Error(`Invalid input to ads-mcp: ${JSON.stringify(error.errors)}`);
|
|
70
|
-
});
|
package/src/instructions.tsx
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const instructions = `
|
|
2
|
-
You are an expert in the Atlassian Design System (aka ADS). You are able to answer questions about the design system and provide guidance on what offerings to use when building user interfaces.
|
|
3
|
-
|
|
4
|
-
You are able to use the provided tools to help answer your questions, but may also access https://atlassian.design/llms.txt or https://atlassian.design/ directly for deeper research and information.
|
|
5
|
-
`;
|
package/src/schema.tsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import zodToJsonSchema from 'zod-to-json-schema';
|
|
3
|
-
|
|
4
|
-
export const releasePhase = z
|
|
5
|
-
.enum(['early_access', 'beta', 'general_availability', 'intent_to_deprecate', 'deprecated'])
|
|
6
|
-
.default('general_availability').describe(`
|
|
7
|
-
The release phase or status of the offering, providing guidance on what you can expect at each phase and who can use them.
|
|
8
|
-
You should typically only use \`general_availability\` or \`beta\` components. If a release phase or status is not defined, you should assume it is \`general_availability\`.
|
|
9
|
-
|
|
10
|
-
- \`early_access\`: New experimental feature. There may be breaking changes in minor releases at versions \`0.x\`. We don't recommend using this unless you are part of an early access pilot group, as support is otherwise not available.
|
|
11
|
-
- \`beta\`: New and ready to use. The feature is supported and stable at versions \`1.0\`+. We are working on improvements based on customer feedback. This may include expanding feature sets, and evolving tooling, guidance, and self-service. Breaking changes will only be made in major releases, and should be infrequent.
|
|
12
|
-
- \`general_availability\`: Fully stable and ready to use.
|
|
13
|
-
- \`intent_to_deprecate\` aka Caution: This feature is being considered for deprecation. There may be some issues with this feature that need to be resolved. If you are not already using the feature, use the recommended alternative instead.
|
|
14
|
-
- \`deprecated\`: This feature is no longer supported and will be removed after the deprecation period ends. We have provided a recommended solution to replace it and communicated how to move to it.
|
|
15
|
-
`);
|
|
16
|
-
|
|
17
|
-
export type ReleasePhase = z.infer<typeof releasePhase>;
|
|
18
|
-
|
|
19
|
-
export const emptyInputSchema = zodToJsonSchema(z.object({}));
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
-
|
|
4
|
-
import { components } from '../get-components/components';
|
|
5
|
-
|
|
6
|
-
const inputSchema = z.object({
|
|
7
|
-
names: z.array(z.string()).describe('The name of the component(s) to get full details about'),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const listGetComponentDetailsTool = {
|
|
11
|
-
name: 'get_component_details',
|
|
12
|
-
description: `You MUST use this to fetch detailed information about a specific Atlassian Design System component(s) including code examples, props, accessibility guidelines, and other usage guidance.
|
|
13
|
-
If you're not sure how to query this, you should use the \`get_components\` tool to get a list of all components and their names before using this tool.
|
|
14
|
-
`,
|
|
15
|
-
annotations: {
|
|
16
|
-
title: 'Get ADS component details',
|
|
17
|
-
readOnlyHint: true,
|
|
18
|
-
destructiveHint: false,
|
|
19
|
-
idempotentHint: true,
|
|
20
|
-
openWorldHint: true,
|
|
21
|
-
},
|
|
22
|
-
inputSchema: zodToJsonSchema(inputSchema),
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const cleanName = (name: string) => name.trim().toLowerCase().replace(/\s+/g, '');
|
|
26
|
-
|
|
27
|
-
export const getComponentDetailsTool = async (params: z.infer<typeof inputSchema>) => {
|
|
28
|
-
const names = params.names.filter(Boolean).map(cleanName);
|
|
29
|
-
|
|
30
|
-
if (!names.length) {
|
|
31
|
-
return {
|
|
32
|
-
isError: true,
|
|
33
|
-
content: [
|
|
34
|
-
{
|
|
35
|
-
type: 'text',
|
|
36
|
-
text: `Error: Required parameter 'names' is missing. Available components: ${components.map((c) => c.name).join(', ')}`,
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const filteredComponents = components.filter((c) => names.includes(cleanName(c.name)));
|
|
43
|
-
|
|
44
|
-
if (!filteredComponents.length) {
|
|
45
|
-
return {
|
|
46
|
-
isError: true,
|
|
47
|
-
content: [
|
|
48
|
-
{
|
|
49
|
-
type: 'text',
|
|
50
|
-
text: `Error: Component not found for '${names.join(', ')}'. Available components: ${components.map((c) => c.name).join(', ')}`,
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
content: filteredComponents.map((component) => ({
|
|
58
|
-
// NOTE: Ideally one day the MCP would support structured content…
|
|
59
|
-
// eg. `type: 'object', data: component`
|
|
60
|
-
type: 'text',
|
|
61
|
-
text: JSON.stringify(component, null, 2),
|
|
62
|
-
})),
|
|
63
|
-
};
|
|
64
|
-
};
|