@syncfusion/documentsdk-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 ADDED
@@ -0,0 +1,204 @@
1
+ # SyncfusionDocumentSDKAssistant MCP Server
2
+
3
+ ## Overview
4
+
5
+ The SyncfusionDocumentSDKAssistant is a specialized [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server designed to enhance development with Syncfusion's Document Processing Libraries, such as PDF, Word, Excel, and PowerPoint. It integrates seamlessly with [MCP-compatible clients](https://modelcontextprotocol.io/clients) to provide intelligent assistance for building applications with Syncfusion<sup style="font-size:70%">&reg;</sup> components.
6
+
7
+ ### Key Features
8
+
9
+ * Intelligent code generation for Syncfusion<sup style="font-size:70%">&reg;</sup> Document Processing Libraries, such as PDF, Word, Excel, and PowerPoint.
10
+ * Detailed component documentation and usage examples.
11
+ * Troubleshooting assistance for common integration challenges.
12
+
13
+ ## Prerequisites
14
+
15
+ Before using SyncfusionDocumentSDKAssistant, 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%">&reg;</sup> CodeStudio](https://www.syncfusion.com/code-studio/), etc.)
19
+ * An active Syncfusion<sup style="font-size:70%">&reg;</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%">&reg;</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%">&reg;</sup> components to enhance their development experience without limitations.
35
+
36
+ ## Installation
37
+
38
+ Before you can invoke the `SyncfusionDocumentSDKAssistant` 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/documentsdk-assistant`
43
+ - **Type**: stdio (standard input/output transport)
44
+ - **Command**: npx
45
+ - **Arguments**: -y
46
+ - **Server name**: syncfusionDocumentSDKAssistant
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
+ SyncfusionDocumentSDKAssistant can be configured in various MCP clients. Below are setup instructions for popular environment:
57
+
58
+ ### Syncfusion<sup style="font-size:70%">&reg;</sup> Code Studio
59
+
60
+ * In [Code Studio](https://www.syncfusion.com/code-studio/), open MCP Marketplace, find `SyncfusionDocumentSDKAssistant`, and click Install.
61
+ * When prompted, enter your [Syncfusion API key](https://syncfusion.com/account/api-key) and click Submit to register.
62
+ * It installs locally on your machine and appears in the Installed list.
63
+ * 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/marketplace).
64
+
65
+ ### VS Code (GitHub Copilot MCP)
66
+
67
+ 1. To configure an MCP server for a specific workspace, you can create a `.vscode/mcp.json` file in your workspace folder.
68
+
69
+ ```json
70
+ {
71
+ "servers": {
72
+ "syncfusion-documentsdk-assistant": {
73
+ "type": "stdio",
74
+ "command": "npx",
75
+ "args": [
76
+ "-y",
77
+ "@syncfusion/documentsdk-assistant@latest"
78
+ ],
79
+ "env": {
80
+ "Syncfusion_API_Key": "YOUR_API_KEY"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ ```
86
+
87
+ 2. After updating the configuration in settings.json, you'll notice a "Start" option at the top of the config. This allows you to easily start the SyncfusionDocumentSDKAssistant server directly from the settings interface without additional commands.
88
+
89
+ 3. Confirm that SyncfusionDocumentSDKAssistant is being used (this does not happen automatically). Look for a statement in the output, which is similar to:
90
+ * `SyncfusionDocumentSDKAssistant is running...` (in VS Code)
91
+
92
+ ### Cursor
93
+
94
+ To configure an MCP server for a specific workspace, you can create a .cursor/mcp.json file in your workspace folder.
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "syncfusion-documentsdk-assistant": {
100
+ "type": "stdio",
101
+ "command": "npx",
102
+ "args": [
103
+ "-y",
104
+ "@syncfusion/documentsdk-assistant@latest"
105
+ ],
106
+ "env": {
107
+ "Syncfusion_API_Key": "YOUR_API_KEY"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ### JetBrains IDEs
115
+
116
+ 1. Go to Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP).
117
+ 2. Click + Add to add a new MCP server configuration.
118
+ 3. In the New MCP Server dialog, switch the dropdown as `As JSON` and add the following config:
119
+
120
+ ```json
121
+ {
122
+ "mcpServers": {
123
+ "syncfusion-documentsdk-assistant": {
124
+ "command": "npx",
125
+ "args": [
126
+ "-y",
127
+ "@syncfusion/documentsdk-assistant@latest"
128
+ ],
129
+ "env": {
130
+ "Syncfusion_API_Key": "YOUR_API_KEY"
131
+ }
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
137
+ 4. Click OK and Apply.
138
+
139
+ For additional configuration details, refer to:
140
+ * [VS Code](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server)
141
+ * [Cursor](https://docs.cursor.com/en/context/mcp#using-mcp-json)
142
+ * [JetBrains](https://www.jetbrains.com/help/ai-assistant/mcp.html#connect-to-an-mcp-server)
143
+ * [Windsurf](https://docs.windsurf.com/windsurf/cascade/mcp#mcp-config-json)
144
+
145
+ ## Usage
146
+
147
+ To activate the SyncfusionDocumentSDKAssistant MCP server:
148
+
149
+ 1. Start your prompt with one of the following:
150
+ * 'SyncfusionDocumentSDKAssistant'
151
+ * '/syncfusion-documentsdk-assistant'
152
+ * '/syncfusion-documentsdk'
153
+ * '@syncfusion-documentsdk'
154
+ * '@ask_syncfusion_documentsdk'
155
+
156
+ In VS Code, you can also use #SyncfusionDocumentSDKAssistant to explicitly invoke the MCP server.
157
+
158
+ 2. Grant the SyncfusionDocumentSDKAssistant MCP server a permission to run for this session, workspace, or always.
159
+ 3. For best results, start a new chat for each new topic to maintain clean context.
160
+
161
+ ### Mode availability
162
+
163
+ Syncfusion<sup style="font-size:70%">&reg;</sup> MCP Servers provide full access to all AI interaction modes — Ask/Chat, Edit, and Agent — across supported MCP clients.
164
+
165
+ ### Best Practices for Effective Usage
166
+
167
+ 1. `Be specific`: Mention both platform and component (e.g., "How to digitally sign a PDF document using Syncfusion PDF library in .NET Core app?").
168
+ 2. `Provide context`: Include details about your use case for more targeted solutions.
169
+ 3. `Use descriptive queries`: Avoid vague questions that lack necessary context.
170
+ 4. `Start fresh for new topics`: Begin a new chat session when switching components or topics.
171
+
172
+ ### Example Queries
173
+
174
+ Here are some effective ways to use SyncfusionDocumentSDKAssistant:
175
+
176
+ * "Create an Excel file with formulas, charts, and conditional formatting using Syncfusion in WPF."
177
+ * "How to perform a mail merge in a Word document using Syncfusion Word library?"
178
+ * "Extract text and images from an existing PDF using Syncfusion."
179
+ * "How do I convert a Word document to PDF using Syncfusion in Blazor app?"
180
+ * "Using Syncfusion, how can I combine multiple PowerPoint presentations into one in a WinUI application?"
181
+
182
+ ## Troubleshooting
183
+
184
+ If you encounter issues:
185
+
186
+ * Verify your API key is correctly configured.
187
+ * Ensure the MCP server is enabled in your client's tools selection.
188
+ * Check that you're using a compatible MCP client version.
189
+ * Try restarting your development environment.
190
+
191
+ ## Support
192
+
193
+ Product support is available through the following mediums.
194
+
195
+ * [Support ticket](https://support.syncfusion.com/support/tickets/create) - Guaranteed Response in 24 hours | Unlimited tickets | Holiday support
196
+ * [Community forum](https://www.syncfusion.com/forums/document-sdk)
197
+ * [Request feature or report bug](https://www.syncfusion.com/feedback/document-sdk)
198
+ * Live chat
199
+
200
+ ## License
201
+ 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).
202
+ 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.
203
+ © Copyright 2025 Syncfusion<sup>®</sup> Inc. All Rights Reserved. The Syncfusion<sup>®</sup> Essential Studio<sup>®</sup> license and copyright applies to this distribution.
204
+ 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 { SyncfusionDocumentSDKAssistantTool } from "./tools/documentsdk.js";
5
+ import { toolRegistry } from "./utils/toolRegistry.js";
6
+ // Register tools in the registry
7
+ toolRegistry.register(SyncfusionDocumentSDKAssistantTool);
8
+ async function runServer() {
9
+ const server = new McpServer({
10
+ name: "SyncfusionDocumentSDKAssistant",
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] SyncfusionDocumentSDKAssistant is running...\n");
44
+ }
45
+ runServer().catch((error) => {
46
+ console.error(`Server error: ${error}`);
47
+ process.exit(1);
48
+ });
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { callSyncfusionHelpbotAPI } from "../utils/helpbot.js";
3
+ const TOOL_NAME = "SyncfusionDocumentSDKAssistant";
4
+ const TOOL_DESCRIPTION = `
5
+ The ${TOOL_NAME} helps you with Syncfusion Document Processing Libraries development questions and provides documentation references. This tool is useful when you need assistance with:
6
+
7
+ 1. Understanding specific Syncfusion Document Processing Libraries like PDF, Word, Excel, PowerPoint, etc.
8
+ 2. Implementation techniques for Syncfusion Document Processing Libraries.
9
+
10
+ Provide your detailed question in the 'query' parameter. When your question involves specific Syncfusion Document Processing Libraries 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
+ - 'SyncfusionDocumentSDKAssistant'
14
+ - '/syncfusion-documentsdk-assistant'
15
+ - '/syncfusion-documentsdk'
16
+ - '@syncfusion-documentsdk'
17
+ - '@ask_syncfusion_documentsdk'
18
+ `;
19
+ // Define the input schema shape for the tool
20
+ const inputSchema = {
21
+ query: z.string().describe("The query used to search for Syncfusion Document Processing Libraries, features, or realworld use cases of Syncfusion components"),
22
+ components: z.string().optional().describe("Retrieve the components list information from the user query make sure to separate components using , .")
23
+ };
24
+ export const SyncfusionDocumentSDKAssistantTool = {
25
+ name: TOOL_NAME,
26
+ description: TOOL_DESCRIPTION,
27
+ inputSchema,
28
+ handler: async ({ query, components }) => {
29
+ try {
30
+ const result = await callSyncfusionHelpbotAPI(query, 'File Formats', components);
31
+ if ('error' in result) {
32
+ if (result.error.includes("401")) {
33
+ return resHandler(`❌ Request failed due to an invalid API key. Please try again with the valid API key.`);
34
+ }
35
+ return resHandler(`❌ Request failed (status ${result.status}): ${result.error}`);
36
+ }
37
+ const systemPrompt = 'Include this information in context for more accurate response generation: ';
38
+ return resHandler(systemPrompt + result.data);
39
+ }
40
+ catch (error) {
41
+ console.error(`Error during Syncfusion Document SDK Assistant processing for query "${query}":`, error);
42
+ const errorMessage = error instanceof Error ? error.message : String(error);
43
+ return resHandler(`❌ An error occurred while processing the request: ${errorMessage}`);
44
+ }
45
+ }
46
+ };
47
+ const resHandler = (msg) => {
48
+ return {
49
+ content: [
50
+ {
51
+ type: 'text',
52
+ text: msg,
53
+ }
54
+ ]
55
+ };
56
+ };
@@ -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": "documentsdk-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/documentsdk-assistant",
3
+ "version": "0.1.0",
4
+ "description": "MCP server that provides efficient access to Syncfusion documentation, implementation guidelines, and code generation for document processing libraries.",
5
+ "type": "module",
6
+ "bin": {
7
+ "documentsdk-assistant": "./dist/index.js"
8
+ },
9
+ "keywords": [
10
+ "MCP Server",
11
+ "Model Context Protocol",
12
+ "Document Processing Libraries",
13
+ "Syncfusion",
14
+ "AI",
15
+ "Copilot",
16
+ "SyncfusionDocumentSDK"
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
+ }