@syncfusion/maui-assistant 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.
- package/README.md +202 -0
- package/dist/index.js +48 -0
- package/dist/tools/maui.js +57 -0
- package/dist/utils/helpbot.js +24 -0
- package/dist/utils/toolRegistry.js +13 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# SyncfusionMAUIAssistant MCP Server
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The SyncfusionMAUIAssistant is a specialized [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server designed to enhance development with Syncfusion's MAUI component libraries. It integrates seamlessly with [MCP-compatible clients](https://modelcontextprotocol.io/clients) to provide intelligent assistance for building MAUI applications with Syncfusion<sup style="font-size:70%">®</sup> components.
|
|
6
|
+
|
|
7
|
+
### Key Features
|
|
8
|
+
|
|
9
|
+
* Intelligent code generation for Syncfusion<sup style="font-size:70%">®</sup> MAUI components.
|
|
10
|
+
* Detailed component documentation and usage examples.
|
|
11
|
+
* Troubleshooting assistance for common integration challenges.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
Before using SyncfusionMAUIAssistant, ensure you have:
|
|
16
|
+
|
|
17
|
+
* Required [node](https://nodejs.org/en/) version >= 18
|
|
18
|
+
* A [compatible MCP client](https://modelcontextprotocol.io/clients) (VS Code with GitHub Copilot, [Syncfusion<sup style="font-size:70%">®</sup> CodeStudio](https://www.syncfusion.com/code-studio/), etc.)
|
|
19
|
+
* An active Syncfusion<sup style="font-size:70%">®</sup> license (any of the following):
|
|
20
|
+
- [Commercial License](https://www.syncfusion.com/sales/unlimitedlicense)
|
|
21
|
+
- [Free Community License](https://www.syncfusion.com/products/communitylicense)
|
|
22
|
+
- [Free Trial](https://www.syncfusion.com/account/manage-trials/start-trials)
|
|
23
|
+
* An active [API KEY](https://syncfusion.com/account/api-key)
|
|
24
|
+
|
|
25
|
+
## Unlimited Access
|
|
26
|
+
|
|
27
|
+
Syncfusion<sup style="font-size:70%">®</sup> offers unlimited access to this MCP server. There are no restrictions on:
|
|
28
|
+
|
|
29
|
+
* Number of requests
|
|
30
|
+
* Components usage
|
|
31
|
+
* Query types
|
|
32
|
+
* Usage duration
|
|
33
|
+
|
|
34
|
+
This ensures users can fully leverage Syncfusion<sup style="font-size:70%">®</sup> components to enhance their development experience without limitations.
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
Before you can invoke the `SyncfusionMAUIAssistant` MCP server, you need to configure your MCP client with these core settings. The **Generic MCP Server Settings** shown below are identical across all clients:
|
|
39
|
+
|
|
40
|
+
### Generic MCP Server Settings
|
|
41
|
+
|
|
42
|
+
- **npm package name**: `@syncfusion/maui-assistant`
|
|
43
|
+
- **Type**: stdio (standard input/output transport)
|
|
44
|
+
- **Command**: npx
|
|
45
|
+
- **Arguments**: -y
|
|
46
|
+
- **Server name**: syncfusionMAUIAssistant
|
|
47
|
+
|
|
48
|
+
You need to add your [Syncfusion API key](https://syncfusion.com/account/api-key) as an env parameter in the configuration file:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
"env": {
|
|
52
|
+
"Syncfusion_API_Key": "YOUR_API_KEY"
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Below are setup instructions for popular MCP clients:
|
|
57
|
+
|
|
58
|
+
### Syncfusion<sup style="font-size:70%">®</sup> Code Studio
|
|
59
|
+
|
|
60
|
+
* In [Code Studio](https://www.syncfusion.com/code-studio/), open MCP Marketplace and navigate to the `Custom Servers` tab.
|
|
61
|
+
* Enter the Server Name as `maui-mcp`, choose Server Type as npm package, and set the NPM Package name to `@syncfusion/maui-assistant`.
|
|
62
|
+
* Add an environment variable as `Syncfusion_API_Key` and value as your [Syncfusion API key](https://syncfusion.com/account/api-key), then click **Install Server**.
|
|
63
|
+
* Once installed, the server will appear in the User Installed Server list, and will be added to the **config.yaml** file.
|
|
64
|
+
* The server is now ready for use in Code Studio. For more details, refer to the [Code Studio documentation](https://help.syncfusion.com/code-studio/reference/configure-properties/mcp/customservers#npm-server).
|
|
65
|
+
|
|
66
|
+
### VS Code (GitHub Copilot MCP)
|
|
67
|
+
|
|
68
|
+
* To configure an MCP server for a specific workspace, you can create a `.vscode/mcp.json` file in your workspace folder.
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"servers": {
|
|
73
|
+
"syncfusion-maui-assistant": {
|
|
74
|
+
"type": "stdio",
|
|
75
|
+
"command": "npx",
|
|
76
|
+
"args": [
|
|
77
|
+
"-y",
|
|
78
|
+
"@syncfusion/maui-assistant@latest"
|
|
79
|
+
],
|
|
80
|
+
"env": {
|
|
81
|
+
"Syncfusion_API_Key": "YOUR_API_KEY"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
* After updating the configuration in mcp.json, you'll notice a "Start" option at the top of the config. This allows you to easily start the SyncfusionMauiAssistant server directly from the settings interface without additional commands.
|
|
89
|
+
|
|
90
|
+
* Confirm the server is active by checking for a message like: `SyncfusionMAUIAssistant is running...` in the output.
|
|
91
|
+
|
|
92
|
+
* For additional guidance, refer to the [VS Code documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_add-an-mcp-server).
|
|
93
|
+
|
|
94
|
+
### Cursor
|
|
95
|
+
|
|
96
|
+
To configure an MCP server for a specific workspace, you can create a .cursor/mcp.json file in your workspace folder.
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"mcpServers": {
|
|
101
|
+
"syncfusion-maui-assistant": {
|
|
102
|
+
"type": "stdio",
|
|
103
|
+
"command": "npx",
|
|
104
|
+
"args": [
|
|
105
|
+
"-y",
|
|
106
|
+
"@syncfusion/maui-assistant@latest"
|
|
107
|
+
],
|
|
108
|
+
"env": {
|
|
109
|
+
"Syncfusion_API_Key": "YOUR_API_KEY"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### JetBrains IDEs
|
|
117
|
+
|
|
118
|
+
* Go to Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP).
|
|
119
|
+
* Click + Add to add a new MCP server configuration.
|
|
120
|
+
* In the New MCP Server dialog, switch the dropdown as `As JSON` and add the following config:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"mcpServers": {
|
|
125
|
+
"syncfusion-maui-assistant": {
|
|
126
|
+
"command": "npx",
|
|
127
|
+
"args": [
|
|
128
|
+
"-y",
|
|
129
|
+
"@syncfusion/maui-assistant@latest"
|
|
130
|
+
],
|
|
131
|
+
"env": {
|
|
132
|
+
"Syncfusion_API_Key": "YOUR_API_KEY"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
* Click OK and Apply.
|
|
140
|
+
|
|
141
|
+
* For further assistance, see the [JetBrains documentation](https://www.jetbrains.com/help/ai-assistant/mcp.html#connect-to-an-mcp-server).
|
|
142
|
+
|
|
143
|
+
> For more detailed information about configuring MCP servers in various clients, refer to the official documentations, e.g., [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp#mcp-config-json)
|
|
144
|
+
|
|
145
|
+
## Usage
|
|
146
|
+
|
|
147
|
+
To activate the SyncfusionMAUIAssistant MCP server:
|
|
148
|
+
|
|
149
|
+
1. Start your prompt with one of the following:
|
|
150
|
+
* 'SyncfusionMAUIAssistant'
|
|
151
|
+
* '/syncfusion-maui-assistant'
|
|
152
|
+
* '/syncfusion-maui'
|
|
153
|
+
* '@syncfusion-maui'
|
|
154
|
+
* '@ask_syncfusion_maui'
|
|
155
|
+
* 'maui'
|
|
156
|
+
|
|
157
|
+
In VS Code, you can use `#SyncfusionMAUIAssistant` for direct invocation.
|
|
158
|
+
|
|
159
|
+
2. Grant permission for the server to run (for the session, workspace, or always).
|
|
160
|
+
3. For best results, start a new chat for each new topic to maintain clean context.
|
|
161
|
+
|
|
162
|
+
### Mode availability
|
|
163
|
+
|
|
164
|
+
Syncfusion<sup style="font-size:70%">®</sup> MCP Servers provide full access to all AI interaction modes — Ask/Chat, Edit, and Agent — across supported MCP clients.
|
|
165
|
+
|
|
166
|
+
### Best Practices for Effective Usage
|
|
167
|
+
|
|
168
|
+
1. `Be specific`: Mention both platform and component (e.g., "How do I create a Syncfusion MAUI Grid with paging and filtering?").
|
|
169
|
+
2. `Provide context`: Include details about your use case for more targeted solutions.
|
|
170
|
+
3. `Use descriptive queries`: Avoid vague questions that lack necessary context.
|
|
171
|
+
4. `Start fresh for new topics`: Begin a new chat session when switching components or topics.
|
|
172
|
+
|
|
173
|
+
### Example Queries
|
|
174
|
+
|
|
175
|
+
Here are some effective ways to use SyncfusionMAUIAssistant:
|
|
176
|
+
|
|
177
|
+
* "Create a Syncfusion MAUI Grid component with paging, sorting and filtering."
|
|
178
|
+
* "How do I implement data binding with Syncfusion MAUI scheduler?"
|
|
179
|
+
|
|
180
|
+
## Troubleshooting
|
|
181
|
+
|
|
182
|
+
If you encounter issues:
|
|
183
|
+
|
|
184
|
+
* Verify your API key is correctly configured.
|
|
185
|
+
* Ensure the MCP server is enabled in your client's tools selection.
|
|
186
|
+
* Check that you're using a compatible MCP client version.
|
|
187
|
+
* Try restarting your development environment.
|
|
188
|
+
|
|
189
|
+
## Support
|
|
190
|
+
|
|
191
|
+
Product support is available through the following mediums.
|
|
192
|
+
|
|
193
|
+
* [Support ticket](https://support.syncfusion.com/support/tickets/create) - Guaranteed Response in 24 hours | Unlimited tickets | Holiday support
|
|
194
|
+
* [Community forum](https://www.syncfusion.com/forums/maui)
|
|
195
|
+
* [Request feature or report bug](https://www.syncfusion.com/feedback/maui)
|
|
196
|
+
* Live chat
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
This is a commercial product and requires a paid license for possession or use. Syncfusion<sup>®</sup> licensed software, including this component, is subject to the terms and conditions of [Syncfusion's EULA](https://www.syncfusion.com/eula/es/). To acquire a license, you can purchase [here](https://www.syncfusion.com/sales/products) or start a free 30-day trial [here](https://www.syncfusion.com/account/manage-trials/start-trials).
|
|
200
|
+
A free [community license](https://www.syncfusion.com/products/communitylicense) is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue and five or fewer developers.
|
|
201
|
+
© Copyright 2025 Syncfusion<sup>®</sup> Inc. All Rights Reserved. The Syncfusion<sup>®</sup> Essential Studio<sup>®</sup> license and copyright applies to this distribution.
|
|
202
|
+
The Syncfusion<sup>®</sup> Essential<sup>®</sup> Studio license and copyright applies to this distribution.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { SyncfusionMAUIAssistantTool } from "./tools/maui.js";
|
|
5
|
+
import { toolRegistry } from "./utils/toolRegistry.js";
|
|
6
|
+
// Register tools in the registry
|
|
7
|
+
toolRegistry.register(SyncfusionMAUIAssistantTool);
|
|
8
|
+
async function runServer() {
|
|
9
|
+
const server = new McpServer({
|
|
10
|
+
name: "SyncfusionMAUIAssistant",
|
|
11
|
+
version: "0.1.0"
|
|
12
|
+
});
|
|
13
|
+
for (const tool of toolRegistry.getAll()) {
|
|
14
|
+
server.tool(tool.name, tool.description, tool.inputSchema, tool.handler);
|
|
15
|
+
}
|
|
16
|
+
const transport = new StdioServerTransport();
|
|
17
|
+
// Set up the transport to listen for incoming messages
|
|
18
|
+
const shutdown = async (signal) => {
|
|
19
|
+
console.info(`Received ${signal}. Shutting down server...`);
|
|
20
|
+
try {
|
|
21
|
+
await transport.close();
|
|
22
|
+
console.info('Server shut down successfully.');
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error(error, 'Error during server shutdown.');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// Handle shutdown signals and errors
|
|
31
|
+
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
32
|
+
process.on('SIGTERM', () => shutdown('SIGTERM'));
|
|
33
|
+
process.on('uncaughtException', (error) => {
|
|
34
|
+
console.error('Uncaught exception:', error);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
});
|
|
37
|
+
process.on('unhandledRejection', (reason, promise) => {
|
|
38
|
+
console.error('Unhandled rejection at:', promise, 'reason:', reason);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
});
|
|
41
|
+
// Start the server and listen for incoming messages on stdin
|
|
42
|
+
await server.connect(transport);
|
|
43
|
+
process.stderr.write("[INFO] SyncfusionMAUIAssistant is running...\n");
|
|
44
|
+
}
|
|
45
|
+
runServer().catch((error) => {
|
|
46
|
+
console.error(`Server error: ${error}`);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { callSyncfusionHelpbotAPI } from "../utils/helpbot.js";
|
|
3
|
+
const TOOL_NAME = "SyncfusionMAUIAssistant";
|
|
4
|
+
const TOOL_DESCRIPTION = `
|
|
5
|
+
The ${TOOL_NAME} helps you with Syncfusion UI for MAUI development questions and provides documentation references. This tool is useful when you need assistance with:
|
|
6
|
+
|
|
7
|
+
1. Understanding specific Syncfusion MAUI components like Grid, Chart, Scheduler, DatePicker, etc.
|
|
8
|
+
2. Implementation techniques for Syncfusion MAUI components
|
|
9
|
+
|
|
10
|
+
Provide your detailed question in the 'query' parameter. When your question involves specific Syncfusion MAUI components it will detect component references for retrieving relevant documentation and assistance.
|
|
11
|
+
This tool understands the context based on the context MCP client will send the proper query to this server.
|
|
12
|
+
This tool can be automatically triggered when any of the following phrases are detected in the user's input:
|
|
13
|
+
- 'SyncfusionMAUIAssistant'
|
|
14
|
+
- '/syncfusion-maui-assistant'
|
|
15
|
+
- '/syncfusion-maui'
|
|
16
|
+
- '@syncfusion-maui'
|
|
17
|
+
- '@ask_syncfusion_maui'
|
|
18
|
+
- 'maui'
|
|
19
|
+
`;
|
|
20
|
+
// Define the input schema shape for the tool
|
|
21
|
+
const inputSchema = {
|
|
22
|
+
query: z.string().describe("The query used to search for Syncfusion MAUI components, features, or realworld use cases of Syncfusion components"),
|
|
23
|
+
components: z.string().optional().describe("Retrieve the components list information from the user query make sure to separate components using , .")
|
|
24
|
+
};
|
|
25
|
+
export const SyncfusionMAUIAssistantTool = {
|
|
26
|
+
name: TOOL_NAME,
|
|
27
|
+
description: TOOL_DESCRIPTION,
|
|
28
|
+
inputSchema,
|
|
29
|
+
handler: async ({ query, components }) => {
|
|
30
|
+
try {
|
|
31
|
+
const result = await callSyncfusionHelpbotAPI(query, 'MAUI', components);
|
|
32
|
+
if ('error' in result) {
|
|
33
|
+
if (result.error.includes("401")) {
|
|
34
|
+
return resHandler(`❌ Request failed due to an invalid API key. Please try again with the valid API key.`);
|
|
35
|
+
}
|
|
36
|
+
return resHandler(`❌ Request failed (status ${result.status}): ${result.error}`);
|
|
37
|
+
}
|
|
38
|
+
const systemPrompt = 'Include this information in context for more accurate response generation: ';
|
|
39
|
+
return resHandler(systemPrompt + result.data);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error(`Error during Syncfusion MAUI Assistant processing for query "${query}":`, error);
|
|
43
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
44
|
+
return resHandler(`❌ An error occurred while processing the request: ${errorMessage}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const resHandler = (msg) => {
|
|
49
|
+
return {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: 'text',
|
|
53
|
+
text: msg,
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
const apiKey = process.env.Syncfusion_API_Key || "";
|
|
3
|
+
export async function callSyncfusionHelpbotAPI(query, platform, components) {
|
|
4
|
+
try {
|
|
5
|
+
const resp = await axios.post("https://helpbot.syncfusion.com/api/documents/search", { "query": `${query} ${components}`, "platform": platform, "tool": "maui-mcp" }, {
|
|
6
|
+
headers: {
|
|
7
|
+
"Content-Type": "application/json",
|
|
8
|
+
"API-Key": apiKey
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const text = JSON.stringify(resp.data, null, 2);
|
|
12
|
+
return { data: text, status: resp.status };
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
if (axios.isAxiosError(err)) {
|
|
16
|
+
const status = err.response?.status ?? 0;
|
|
17
|
+
const message = (typeof err.response?.data === 'string'
|
|
18
|
+
? err.response.data
|
|
19
|
+
: JSON.stringify(err.response?.data)) || err.message;
|
|
20
|
+
return { error: message, status };
|
|
21
|
+
}
|
|
22
|
+
return { error: err.message, status: 0 };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ToolRegistry {
|
|
2
|
+
tools = new Map();
|
|
3
|
+
register(tool) {
|
|
4
|
+
this.tools.set(tool.name, tool);
|
|
5
|
+
}
|
|
6
|
+
getAll() {
|
|
7
|
+
return Array.from(this.tools.values());
|
|
8
|
+
}
|
|
9
|
+
getTool(name) {
|
|
10
|
+
return this.tools.get(name);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export const toolRegistry = new ToolRegistry();
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@syncfusion/maui-assistant",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server that provides efficient access to Syncfusion documentation, implementation guidelines, and code generation for MAUI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"maui-assistant": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"MCP Server",
|
|
11
|
+
"Model Context Protocol",
|
|
12
|
+
"MAUI",
|
|
13
|
+
"Syncfusion",
|
|
14
|
+
"AI",
|
|
15
|
+
"Copilot",
|
|
16
|
+
"SyncfusionMAUI"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"assets"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@modelcontextprotocol/sdk": "1.13.2",
|
|
24
|
+
"axios": "1.12.1"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"start": "tsc",
|
|
29
|
+
"inspector": "npx @modelcontextprotocol/inspector dist/index.js"
|
|
30
|
+
}
|
|
31
|
+
}
|