Skip to content

Commit d886ca4

Browse files
authored
Merge pull request #3983 from syncfusion-content/MCP-Server-for-WFPdfViewer
Added WinForms PdfViewer MCP changes
2 parents d5b721b + 3550de2 commit d886ca4

3 files changed

Lines changed: 270 additions & 0 deletions

File tree

Document-Processing-toc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,6 +2591,9 @@
25912591
<li>
25922592
<a href="/document-processing/pdf/pdf-viewer/winforms/ui-builder-skill">Agentic UI Builder Skill</a>
25932593
</li>
2594+
<li>
2595+
<a href="/document-processing/pdf/pdf-viewer/winforms/pdfviewer-mcp">MCP Server</a>
2596+
</li>
25942597
<li><a href="/document-processing/pdf/pdf-viewer/winforms/pdf-rendering-engines">PDF Rendering Engines</a></li>
25952598
<li>
25962599
<a href="/document-processing/pdf/pdf-viewer/winforms/working-with-pdf-viewer">Working with PdfViewerControl</a>
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
---
2+
layout: post
3+
title: Syncfusion Windows Forms PDF Viewer MCP Server Setup – Syncfusion
4+
description: Discover the MCP server's advantages, installation requirements, and integration guidance for Syncfusion Windows Forms PDF Viewer.
5+
platform: document-processing
6+
control: AI coding assistant
7+
documentation: ug
8+
---
9+
10+
# Syncfusion Windows Forms PDF Viewer MCP Server
11+
12+
Syncfusion<sup style="font-size:70%">&reg;</sup> Windows Forms MCP Server accelerates Windows Forms PDF Viewer application development by providing deep knowledge directly in your AI-powered IDE. [Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro) (MCP) integration enables quick access to documentation, API references, and code-generation features from within the development environment.
13+
14+
These tools speed up development and reinforce best practices for Syncfusion Windows Forms PDF Viewer integration.
15+
16+
## Key Benefits
17+
18+
- **Expert PDF Viewer Knowledge** - Deep understanding of Syncfusion Windows Forms PDF Viewer component and its implementation patterns.
19+
- **Unlimited Usage** - No request limits, time restrictions, or query caps.
20+
- **Privacy-Focused** - The tools operate based on the user's query and do not store any content, data, or prompts.
21+
22+
## Installation
23+
24+
### Prerequisites
25+
26+
Before beginning, ensure the following prerequisites are met:
27+
28+
- Microsoft [.NET SDK 8.0](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or later
29+
- A **compatible MCP client** (VS Code, Syncfusion<sup style="font-size:70%">&reg;</sup> Code Studio, Cursor, JetBrains, etc.)
30+
- An active [Syncfusion<sup style="font-size:70%">&reg;</sup> API key](https://syncfusion.com/account/api-key)
31+
- A **Windows Forms PDF Viewer application** (existing or new); see [Syncfusion Windows Forms PDF Viewer documentation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/winforms/getting-started)
32+
- An active Syncfusion<sup style="font-size:70%">&reg;</sup> license (any of the following):
33+
- [Commercial License](https://www.syncfusion.com/sales/unlimitedlicense)
34+
- [Free Community License](https://www.syncfusion.com/products/communitylicense)
35+
- [Free Trial](https://www.syncfusion.com/account/manage-trials/start-trials)
36+
37+
### Getting Your API Key
38+
39+
Generate the Syncfusion<sup style="font-size:70%">&reg;</sup> API key from the [API Key page](https://www.syncfusion.com/account/api-key) and store it in a `.txt` or `.key` file. The saved file will be referenced in the MCP configuration:
40+
41+
````json
42+
"env": {
43+
"Syncfusion_API_Key_Path": "D:\\syncfusion-key.txt"
44+
}
45+
````
46+
47+
> Alternatively, the API key can also be set directly using `"Syncfusion_API_Key": "YOUR_API_KEY"` in the env configuration. Using a file path is recommended to keep the key out of source control.
48+
49+
### Setting Up in MCP Clients
50+
51+
Create a configuration file in your project folder to install the server for your workspace. **Replace `YOUR_API_KEY_FILE_PATH` with the path to your API key file.** The tabs below show a working configuration for each supported MCP client.
52+
53+
**For .NET 10** :
54+
55+
{% tabs %}
56+
{% highlight bash tabtitle="VS Code" %}
57+
58+
// Create a `.vscode/mcp.json` file in your workspace:
59+
60+
{
61+
"servers": {
62+
"sf-winforms-mcp": {
63+
"type": "stdio",
64+
"command": "dnx",
65+
"args": ["Syncfusion.WinForms.MCP", "--yes"],
66+
"env": {
67+
"Syncfusion_API_Key_Path": "YOUR_API_KEY_FILE_PATH"
68+
// or
69+
// "Syncfusion_API_Key": "YOUR_API_KEY"
70+
}
71+
}
72+
}
73+
}
74+
75+
{% endhighlight %}
76+
{% highlight bash tabtitle="Code Studio" %}
77+
78+
// Create a `.codestudio/mcp.json` file in your workspace:
79+
80+
{
81+
"servers": {
82+
"sf-winforms-mcp": {
83+
"type": "stdio",
84+
"command": "dnx",
85+
"args": ["Syncfusion.WinForms.MCP", "--yes"],
86+
"env": {
87+
"Syncfusion_API_Key_Path": "YOUR_API_KEY_FILE_PATH"
88+
// or
89+
// "Syncfusion_API_Key": "YOUR_API_KEY"
90+
}
91+
}
92+
}
93+
}
94+
95+
// After creating the file, click Start in the inline action to install the server.
96+
97+
{% endhighlight %}
98+
{% highlight bash tabtitle="Cursor" %}
99+
100+
// Create a `.cursor/mcp.json` file in your workspace:
101+
102+
{
103+
"mcpServers": {
104+
"sf-winforms-mcp": {
105+
"command": "dnx",
106+
"args": ["Syncfusion.WinForms.MCP", "--yes"],
107+
"env": {
108+
"Syncfusion_API_Key_Path": "YOUR_API_KEY_FILE_PATH"
109+
// or
110+
// "Syncfusion_API_Key": "YOUR_API_KEY"
111+
}
112+
}
113+
}
114+
}
115+
116+
{% endhighlight %}
117+
{% highlight bash tabtitle="JetBrains" %}
118+
119+
// Open AI Assistant chat, type /, and select Add Command.
120+
// Click ➕ Add on the MCP settings page.
121+
// Choose STDIO and select JSON configuration:
122+
123+
{
124+
"mcpServers": {
125+
"sf-winforms-mcp": {
126+
"command": "dnx",
127+
"args": ["Syncfusion.WinForms.MCP", "--yes"],
128+
"env": {
129+
"Syncfusion_API_Key_Path": "YOUR_API_KEY_FILE_PATH"
130+
// or
131+
// "Syncfusion_API_Key": "YOUR_API_KEY"
132+
}
133+
}
134+
}
135+
}
136+
137+
// Click OK, then click Apply. The server starts and shows Connected status.
138+
139+
{% endhighlight %}
140+
{% endtabs %}
141+
142+
**For .NET 8 / .NET 9 (using a local tool):**
143+
144+
You can install the Syncfusion WinForms MCP Server as a local tool without requiring a global installation. For guidance on installing and managing local .NET tools, refer to the [documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/local-tools-how-to-use).
145+
146+
1. Install the Syncfusion WinForms MCP tool locally:
147+
148+
````bash
149+
dotnet tool install Syncfusion.WinForms.MCP
150+
````
151+
152+
2. In your MCP client config (for example, `.vscode/mcp.json`), replace the server entry with:
153+
154+
````json
155+
{
156+
"servers": {
157+
"sf-winforms-mcp": {
158+
"type": "stdio",
159+
"command": "dotnet",
160+
"args": ["tool", "run", "syncfusion-winforms-mcp"],
161+
"env": {
162+
"Syncfusion_API_Key_Path": "YOUR_API_KEY_FILE_PATH"
163+
// or
164+
// "Syncfusion_API_Key": "YOUR_API_KEY"
165+
}
166+
}
167+
}
168+
}
169+
````
170+
171+
**Verifying Installation** Check your editor's MCP Server list for `sf-winforms-mcp` with a **Connected** status to confirm a successful installation.
172+
173+
## Common use cases
174+
175+
The examples below showcase how the `search_docs` tool handles real-world Windows Forms PDF Viewer development scenarios. The tool can be invoked directly, as shown in the examples below, for specific needs. Alternatively, an AI assistant can automatically invoke it based on the request.
176+
177+
**Get Started**
178+
179+
Use `search_docs` to get contextual guidance, code snippets, and configuration examples for the Windows Forms PDF Viewer component.
180+
181+
{% promptcards %}
182+
{% promptcard PDF Viewer Getting Started %}
183+
#search_docs How do I add the PDF Viewer component to a WinForms application?
184+
{% endpromptcard %}
185+
{% endpromptcards %}
186+
187+
{% promptcards %}
188+
{% promptcard Load PDF Document %}
189+
#search_docs How do I load PDF document to the PDF Viewer?
190+
{% endpromptcard %}
191+
{% endpromptcards %}
192+
193+
**Implement Features**
194+
195+
Get step-by-step help for adding specific features to the Windows Forms PDF Viewer.
196+
197+
{% promptcards %}
198+
{% promptcard Bookmark Navigation %}
199+
#search_docs Provide information for how to programmatically navigate to Bookmark
200+
{% endpromptcard %}
201+
{% endpromptcards %}
202+
203+
{% promptcards %}
204+
{% promptcard Customize Print Size %}
205+
#search_docs how to customize the print size in pdfviewer?
206+
{% endpromptcard %}
207+
{% endpromptcards %}
208+
209+
**Troubleshooting**
210+
211+
Describe the problem in plain language, and let `search_docs` help resolve it.
212+
{% promptcards %}
213+
{% promptcard PDF Document Not Loaded %}
214+
#search_docs Why the PDF Document not loaded in the PdfViewer?
215+
{% endpromptcard %}
216+
{% endpromptcards %}
217+
218+
{% promptcards %}
219+
{% promptcard Extract Text Issues %}
220+
#search_docs Why does the Extract Text API not extract text from a PDF document in the WPF PDF Viewer?
221+
{% endpromptcard %}
222+
{% endpromptcards %}
223+
224+
## Best Practices
225+
226+
To get the most out of the Syncfusion<sup style="font-size:70%">&reg;</sup> WinForms MCP Server:
227+
228+
- **Be Specific** - Include the component and use case in your queries (for example, *"Load PDF document into the PDF Viewer and Print it"*).
229+
- **Provide Context** - Include applicable versions (.NET 8, 9, 10), expected outcomes, and any requirements or limitations that may affect the request.
230+
- **Use Descriptive Queries** - Avoid overly brief or ambiguous requests. Providing sufficient detail helps improve the accuracy and relevance of the response.
231+
- **Stay Consistent** - Keep file organization, naming conventions, and coding standards consistent throughout your WinForms project.
232+
- **Start Fresh for New Topics** - Begin a new chat when switching to a different feature or task to maintain clean context.
233+
- **Use Advanced AI Models** - For the best results, use advanced AI models such as the latest-generation **Claude**, **GPT**, or **Gemini** models.
234+
- **For Troubleshooting** - Use AI suggestions for common issues; consult the [official documentation](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/winforms/getting-started) or [support](https://support.syncfusion.com/support/tickets/create) for complex problems.
235+
- **Minimize Active Tools** - Limit the number of active MCP tools in your IDE to prevent tool-selection ambiguity and improve response accuracy.
236+
237+
> Always review AI-generated code before using it in production.
238+
239+
## Troubleshooting
240+
241+
The table below lists frequently encountered issues and suggested resolutions to help diagnose and address common setup or usage challenges.
242+
243+
| Issue | Solution |
244+
|-------|----------|
245+
| **Server failed to start** | Update to .NET 8 SDK or higher, verify JSON syntax in the config file, and restart your IDE. |
246+
| **Invalid API key** | Verify your key is active at the [Syncfusion Account Page](https://syncfusion.com/account/api-key). |
247+
| **Incorrect API key config** | For the file path: verify file location and content. For inline key: check the key is correctly updated. |
248+
| **Wrong config file location** | VS Code: `.vscode/mcp.json` • Code Studio: `.codestudio/mcp.json` • Cursor: `.cursor/mcp.json` in the workspace root. |
249+
| **Check IDE logs** | VS Code / Code Studio: Output panel → "MCP" • Cursor: Developer Console for MCP errors. |
250+
| **PDF Viewer not rendering** | Ensure the `Syncfusion.PdfViewer.Windows` NuGet packages are installed, and the license key is configured. |
251+
252+
## Privacy & Security
253+
254+
The Syncfusion<sup style="font-size:70%">&reg;</sup> MCP Servers are designed with privacy considerations:
255+
256+
* The tools process requests according to the user's query without storing any content or prompts.
257+
* User prompts are not stored or used for other purposes.
258+
* Prompts are not used to train Syncfusion models.
259+
* The assistant provides context; the final output is produced by the selected AI model.
260+
261+
The MCP Server acts purely as a knowledge bridge, connecting your AI model with Syncfusion-specific expertise while respecting your privacy and maintaining security.
262+
263+
## See also
264+
265+
- [Model Context Protocol](https://modelcontextprotocol.io/docs/2026-07-28/getting-started/intro)

Document-Processing/mcp-server/pdfviewersdk-mcp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ You can refer to the platform-specific guidance on how to set up and use the Syn
3131
- [MCP Server for JavaScript PDF Viewer](../PDF/PDF-Viewer/javascript-es5/mcp)
3232
- [MCP Server for ASP.NET Core PDF Viewer](../PDF/PDF-Viewer/asp-net-core/mcp)
3333
- [MCP Server for ASP.NET MVC PDF Viewer](../PDF/PDF-Viewer/asp-net-mvc/mcp)
34+
- [MCP Server for WPF PDF Viewer](../PDF/PDF-Viewer/wpf/pdfviewer-mcp)
35+
- [MCP Server for WinForms PDF Viewer](../PDF/PDF-Viewer/winforms/pdfviewer-mcp)
3436

3537
## See also
3638

0 commit comments

Comments
 (0)