@backstage-community/plugin-mcp-chat 0.0.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.
- package/README.md +361 -0
- package/config.d.ts +47 -0
- package/dist/api/McpChatApi.esm.js +55 -0
- package/dist/api/McpChatApi.esm.js.map +1 -0
- package/dist/api/index.esm.js +8 -0
- package/dist/api/index.esm.js.map +1 -0
- package/dist/components/BotIcon/BotIcon.esm.js +57 -0
- package/dist/components/BotIcon/BotIcon.esm.js.map +1 -0
- package/dist/components/ChatContainer/ChatContainer.esm.js +246 -0
- package/dist/components/ChatContainer/ChatContainer.esm.js.map +1 -0
- package/dist/components/ChatContainer/ChatMessage.esm.js +466 -0
- package/dist/components/ChatContainer/ChatMessage.esm.js.map +1 -0
- package/dist/components/ChatContainer/QuickStart.esm.js +271 -0
- package/dist/components/ChatContainer/QuickStart.esm.js.map +1 -0
- package/dist/components/ChatContainer/TypingIndicator.esm.js +154 -0
- package/dist/components/ChatContainer/TypingIndicator.esm.js.map +1 -0
- package/dist/components/ChatPage/ChatPage.esm.js +142 -0
- package/dist/components/ChatPage/ChatPage.esm.js.map +1 -0
- package/dist/components/ChatPage/index.esm.js +2 -0
- package/dist/components/ChatPage/index.esm.js.map +1 -0
- package/dist/components/RightPane/ActiveMcpServers.esm.js +159 -0
- package/dist/components/RightPane/ActiveMcpServers.esm.js.map +1 -0
- package/dist/components/RightPane/ActiveTools.esm.js +308 -0
- package/dist/components/RightPane/ActiveTools.esm.js.map +1 -0
- package/dist/components/RightPane/ProviderStatus.esm.js +225 -0
- package/dist/components/RightPane/ProviderStatus.esm.js.map +1 -0
- package/dist/components/RightPane/RightPane.esm.js +242 -0
- package/dist/components/RightPane/RightPane.esm.js.map +1 -0
- package/dist/hooks/useAvailableTools.esm.js +33 -0
- package/dist/hooks/useAvailableTools.esm.js.map +1 -0
- package/dist/hooks/useMcpServers.esm.js +40 -0
- package/dist/hooks/useMcpServers.esm.js.map +1 -0
- package/dist/hooks/useProviderStatus.esm.js +22 -0
- package/dist/hooks/useProviderStatus.esm.js.map +1 -0
- package/dist/index.d.ts +150 -0
- package/dist/index.esm.js +3 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/plugin.esm.js +33 -0
- package/dist/plugin.esm.js.map +1 -0
- package/dist/routes.esm.js +8 -0
- package/dist/routes.esm.js.map +1 -0
- package/package.json +91 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
|
+
import { IconComponent } from '@backstage/core-plugin-api';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* MCP Chat plugin.
|
|
7
|
+
@public
|
|
8
|
+
*/
|
|
9
|
+
declare const mcpChatPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
10
|
+
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
/**
|
|
13
|
+
* MCP Chat Page
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
declare const McpChatPage: () => react_jsx_runtime.JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* MCP Chat Icon
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
declare const MCPChatIcon: IconComponent;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* MCP server connection types
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
declare enum MCPServerType {
|
|
28
|
+
STDIO = "stdio",
|
|
29
|
+
SSE = "sse",
|
|
30
|
+
STREAMABLE_HTTP = "streamable-http"
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
interface ProviderStatusData {
|
|
36
|
+
providers: Provider[];
|
|
37
|
+
summary: {
|
|
38
|
+
totalProviders: number;
|
|
39
|
+
healthyProviders: number;
|
|
40
|
+
error?: string;
|
|
41
|
+
};
|
|
42
|
+
timestamp: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
interface Provider {
|
|
48
|
+
id: string;
|
|
49
|
+
model: string;
|
|
50
|
+
baseUrl: string;
|
|
51
|
+
connection: ProviderConnectionStatus;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
interface ProviderConnectionStatus {
|
|
57
|
+
connected: boolean;
|
|
58
|
+
models?: string[];
|
|
59
|
+
error?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
interface MCPServerStatusData {
|
|
65
|
+
total: number;
|
|
66
|
+
valid: number;
|
|
67
|
+
active: number;
|
|
68
|
+
servers: MCPServer[];
|
|
69
|
+
timestamp: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
interface MCPServer {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
scriptPath?: string;
|
|
78
|
+
npxCommand?: string;
|
|
79
|
+
args?: string[];
|
|
80
|
+
url?: string;
|
|
81
|
+
type: MCPServerType;
|
|
82
|
+
status: {
|
|
83
|
+
valid: boolean;
|
|
84
|
+
connected: boolean;
|
|
85
|
+
error?: string;
|
|
86
|
+
};
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
interface Tool {
|
|
93
|
+
type: string;
|
|
94
|
+
function: {
|
|
95
|
+
name: string;
|
|
96
|
+
description: string;
|
|
97
|
+
parameters: any;
|
|
98
|
+
};
|
|
99
|
+
serverId: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
interface ToolsResponse {
|
|
105
|
+
message: string;
|
|
106
|
+
serverConfigs: Array<{
|
|
107
|
+
name: string;
|
|
108
|
+
type: string;
|
|
109
|
+
hasUrl: boolean;
|
|
110
|
+
hasNpxCommand: boolean;
|
|
111
|
+
hasScriptPath: boolean;
|
|
112
|
+
}>;
|
|
113
|
+
availableTools: Tool[];
|
|
114
|
+
toolCount: number;
|
|
115
|
+
timestamp: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
interface ChatMessage {
|
|
121
|
+
role: 'user' | 'assistant';
|
|
122
|
+
content: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* @public
|
|
126
|
+
*/
|
|
127
|
+
interface ChatResponse {
|
|
128
|
+
role: 'assistant';
|
|
129
|
+
content: string;
|
|
130
|
+
toolResponses?: any[];
|
|
131
|
+
toolsUsed?: string[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
137
|
+
interface McpChatApi {
|
|
138
|
+
sendChatMessage(messages: ChatMessage[], enabledTools?: string[], signal?: AbortSignal): Promise<ChatResponse>;
|
|
139
|
+
getMCPServerStatus(): Promise<MCPServerStatusData>;
|
|
140
|
+
getAvailableTools(): Promise<ToolsResponse>;
|
|
141
|
+
getProviderStatus(): Promise<ProviderStatusData>;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @public
|
|
146
|
+
*/
|
|
147
|
+
declare const mcpChatApiRef: _backstage_core_plugin_api.ApiRef<McpChatApi>;
|
|
148
|
+
|
|
149
|
+
export { MCPChatIcon, MCPServerType, McpChatPage, mcpChatApiRef, mcpChatPlugin };
|
|
150
|
+
export type { ChatMessage, ChatResponse, MCPServer, MCPServerStatusData, McpChatApi, Provider, ProviderConnectionStatus, ProviderStatusData, Tool, ToolsResponse };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createPlugin, createApiFactory, fetchApiRef, discoveryApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
2
|
+
import { rootRouteRef } from './routes.esm.js';
|
|
3
|
+
import { mcpChatApiRef } from './api/index.esm.js';
|
|
4
|
+
import { McpChat } from './api/McpChatApi.esm.js';
|
|
5
|
+
import { BotIconComponent } from './components/BotIcon/BotIcon.esm.js';
|
|
6
|
+
|
|
7
|
+
const mcpChatPlugin = createPlugin({
|
|
8
|
+
id: "mcp-chat",
|
|
9
|
+
routes: {
|
|
10
|
+
root: rootRouteRef
|
|
11
|
+
},
|
|
12
|
+
apis: [
|
|
13
|
+
createApiFactory({
|
|
14
|
+
api: mcpChatApiRef,
|
|
15
|
+
deps: {
|
|
16
|
+
discoveryApi: discoveryApiRef,
|
|
17
|
+
fetchApi: fetchApiRef
|
|
18
|
+
},
|
|
19
|
+
factory: ({ discoveryApi, fetchApi }) => new McpChat({ discoveryApi, fetchApi })
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
const McpChatPage = mcpChatPlugin.provide(
|
|
24
|
+
createRoutableExtension({
|
|
25
|
+
name: "McpChatPage",
|
|
26
|
+
component: () => import('./components/ChatPage/index.esm.js').then((m) => m.ChatPage),
|
|
27
|
+
mountPoint: rootRouteRef
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
const MCPChatIcon = BotIconComponent;
|
|
31
|
+
|
|
32
|
+
export { MCPChatIcon, McpChatPage, mcpChatPlugin };
|
|
33
|
+
//# sourceMappingURL=plugin.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createPlugin,\n createRoutableExtension,\n createApiFactory,\n discoveryApiRef,\n fetchApiRef,\n IconComponent,\n} from '@backstage/core-plugin-api';\n\nimport { rootRouteRef } from './routes';\nimport { mcpChatApiRef } from './api';\nimport { McpChat } from './api/McpChatApi';\nimport { BotIconComponent } from './components/BotIcon';\n\n/**\n * MCP Chat plugin.\n @public\n */\n\nexport const mcpChatPlugin = createPlugin({\n id: 'mcp-chat',\n routes: {\n root: rootRouteRef,\n },\n apis: [\n createApiFactory({\n api: mcpChatApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n fetchApi: fetchApiRef,\n },\n factory: ({ discoveryApi, fetchApi }) =>\n new McpChat({ discoveryApi, fetchApi }),\n }),\n ],\n});\n\n/**\n * MCP Chat Page\n * @public\n */\nexport const McpChatPage = mcpChatPlugin.provide(\n createRoutableExtension({\n name: 'McpChatPage',\n component: () => import('./components/ChatPage').then(m => m.ChatPage),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * MCP Chat Icon\n * @public\n */\nexport const MCPChatIcon: IconComponent = BotIconComponent;\n"],"names":[],"mappings":";;;;;;AAkCO,MAAM,gBAAgB,YAAA,CAAa;AAAA,EACxC,EAAA,EAAI,UAAA;AAAA,EACJ,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,aAAA;AAAA,MACL,IAAA,EAAM;AAAA,QACJ,YAAA,EAAc,eAAA;AAAA,QACd,QAAA,EAAU;AAAA,OACZ;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,QAAA,EAAS,KACjC,IAAI,OAAA,CAAQ,EAAE,YAAA,EAAc,QAAA,EAAU;AAAA,KACzC;AAAA;AAEL,CAAC;AAMM,MAAM,cAAc,aAAA,CAAc,OAAA;AAAA,EACvC,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,aAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,oCAAuB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,QAAQ,CAAA;AAAA,IACrE,UAAA,EAAY;AAAA,GACb;AACH;AAMO,MAAM,WAAA,GAA6B;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'mcp-chat',\n});\n"],"names":[],"mappings":";;AAiBO,MAAM,eAAe,cAAA,CAAe;AAAA,EACzC,EAAA,EAAI;AACN,CAAC;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage-community/plugin-mcp-chat",
|
|
3
|
+
"description": "A Backstage plugin that provides a chat interface for interacting with the MCP Servers.",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public",
|
|
10
|
+
"main": "dist/index.esm.js",
|
|
11
|
+
"types": "dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"backstage": {
|
|
14
|
+
"role": "frontend-plugin",
|
|
15
|
+
"pluginId": "mcp-chat",
|
|
16
|
+
"supported-versions": "1.40.0",
|
|
17
|
+
"pluginPackage": "@backstage-community/plugin-mcp-chat",
|
|
18
|
+
"pluginPackages": [
|
|
19
|
+
"@backstage-community/plugin-mcp-chat"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"scripts": {
|
|
24
|
+
"start": "backstage-cli package start",
|
|
25
|
+
"build": "backstage-cli package build",
|
|
26
|
+
"lint": "backstage-cli package lint",
|
|
27
|
+
"test": "backstage-cli package test",
|
|
28
|
+
"clean": "backstage-cli package clean",
|
|
29
|
+
"prepack": "backstage-cli package prepack",
|
|
30
|
+
"postpack": "backstage-cli package postpack"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@backstage/core-components": "^0.17.3",
|
|
34
|
+
"@backstage/core-plugin-api": "^1.10.8",
|
|
35
|
+
"@backstage/errors": "^1.2.7",
|
|
36
|
+
"@backstage/theme": "^0.6.6",
|
|
37
|
+
"@mui/icons-material": "^5.17.1",
|
|
38
|
+
"@mui/material": "^5.17.1",
|
|
39
|
+
"react-markdown": "^10.1.0",
|
|
40
|
+
"react-use": "^17.2.4"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
44
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
45
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
46
|
+
"react-router": "^6.3.0",
|
|
47
|
+
"react-router-dom": "^6.3.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@backstage/cli": "^0.33.0",
|
|
51
|
+
"@backstage/dev-utils": "^1.1.11",
|
|
52
|
+
"@backstage/test-utils": "^1.7.8",
|
|
53
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
54
|
+
"@testing-library/react": "^14.0.0",
|
|
55
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
56
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
57
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
58
|
+
"react-router-dom": "^6.3.0"
|
|
59
|
+
},
|
|
60
|
+
"files": [
|
|
61
|
+
"dist",
|
|
62
|
+
"app-config.yaml",
|
|
63
|
+
"config.d.ts"
|
|
64
|
+
],
|
|
65
|
+
"configSchema": "config.d.ts",
|
|
66
|
+
"repository": {
|
|
67
|
+
"type": "git",
|
|
68
|
+
"url": "https://github.com/backstage/community-plugins",
|
|
69
|
+
"directory": "workspaces/mcp-chat/plugins/mcp-chat"
|
|
70
|
+
},
|
|
71
|
+
"keywords": [
|
|
72
|
+
"backstage-plugin",
|
|
73
|
+
"chat-interface",
|
|
74
|
+
"mcp",
|
|
75
|
+
"model-context-protocol"
|
|
76
|
+
],
|
|
77
|
+
"homepage": "https://github.com/backstage/community-plugins/tree/main/workspaces/mcp-chat/plugins/mcp-chat",
|
|
78
|
+
"bugs": "https://github.com/backstage/community-plugins/issues",
|
|
79
|
+
"maintainers": [
|
|
80
|
+
"Lucifergene"
|
|
81
|
+
],
|
|
82
|
+
"author": "Avik Kundu",
|
|
83
|
+
"typesVersions": {
|
|
84
|
+
"*": {
|
|
85
|
+
"package.json": [
|
|
86
|
+
"package.json"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"module": "./dist/index.esm.js"
|
|
91
|
+
}
|