foxit-pdf-api-mcp-server
Foxit PDF APIは、PDFドキュメントの生成、編集、変換を自動化するための強力なツールです。Pythonで簡単に使用でき、APIを通じてPDFファイルの操作を効率化します。特に、ビジネスプロセスの自動化や文書管理において高い効果を発揮します。
GitHubスター
7
ユーザー評価
未評価
お気に入り
0
閲覧数
19
フォーク
0
イシュー
2
Foxit Cloud API MCP Server
A Model Context Protocol (MCP) server that integrates Foxit Cloud API PDF manipulation tools directly into your development workflow through GitHub Copilot in Visual Studio Code.
🚀 Features
The Foxit Cloud API MCP Server provides the following tools for PDF manipulation:
- convert_pdf_to_file: Convert a PDF file to formats like text, images, Word, Excel, HTML, or PowerPoint.
- convert_file_to_pdf: Convert files (e.g., docx, pptx, xlsx, txt, images) to PDF format.
- convert_url_to_pdf: Convert a web page from a URL to a PDF file.
- combine_pdfs: Merge multiple PDF files into a single PDF document.
- compare_pdfs: Compare two PDF files and generate a report or visual difference document.
- compress_pdf: Compress a PDF file to reduce its size with adjustable compression levels.
- extract_pdf: Extract text, images from a PDF file.
- flatten_pdf: Remove interactive elements (e.g., forms, annotations) to create a static PDF.
- linearize_pdf: Optimize a PDF file for fast web viewing with progressive loading.
- remove_pdf_password: Remove password protection from a PDF file using the owner password.
- protect_pdf: Add password encryption to a PDF file with user and owner passwords.
- split_pdf: Split a PDF file into multiple files based on the number of pages per file.
- manipulate_pdf: Perform page manipulations like moving, deleting, adding, or rotating pages.
📋 Prerequisites
Before getting started, ensure you have:
- Python 3.10 or higher installed and added to your PATH
- Visual Studio Code with the GitHub Copilot extension which supports Agent Mode and Model Context Protocol (MCP) capabilities.
- pip package manager (latest version recommended)
- Foxit Cloud API credentials (Client ID and Client Secret)
🔧 Installation
Step 1: Get Your API Credentials
- Visit the Foxit Cloud API portal
- Sign up for a free account
- Obtain your Client ID and Client Secret
- The offical host URL for the API is
https://na1.fusion.foxit.com/pdf-services/api
Step 2: Build and Install the Package
Clone this repository and navigate to the project directory:
git clone <repository-url> cd foxit-pdf-api-mcp-server/stdio-python
Ensure you have
setuptools
installed:pip install setuptools wheel
and then build the package by following commands:
python setup.py sdist bdist_wheel
Install the package:
pip install ./dist/foxit_pdf_cloudapi-1.0.0-py3-none-any.whl
Note: Replace the version number with the actual version generated during build.
Step 3: Configure VS Code
Open VS Code and access the Command Palette:
- Windows/Linux:
Ctrl+Shift+P
- macOS:
Cmd+Shift+P
- Windows/Linux:
Type
MCP
and select "MCP: Add Server..."Choose "Command (stdio)" as the server type
Enter the following command and arguments:
foxit-cloudapi-mcp-service --host https://na1.fusion.foxit.com/pdf-services/api --client_id ${input:client-id} --client_secret ${input:client-secret}
Choose your configuration scope:
- User Setting: Global configuration for all VS Code projects
- Workspace Setting: Project-specific configuration
Note:Please visit VS Code settings document for more details on MCP server configuration.
When prompted, enter your Foxit Cloud API credentials.The configuration will be saved as:
{
"version": "1.0",
"name": "Foxit Cloud API MCP Server",
"description": "MCP Server for Foxit Cloud API PDF manipulation tools",
"type": "stdio",
"command": "foxit-cloudapi-mcp-service",
"args": [
"--host",
"https://na1.fusion.foxit.com/pdf-services/api",
"--client_id",
"${input:client-id}",
"--client_secret",
"${input:client-id}"
]
}
Note: Two placeholders (${input:client-id} and ${input:client-id}) need to be manually replaced with your actual credentials.
🎯 Usage
Starting the Server
Using VS Code Interface:
- Open
mcp.json
orsettings.json
file where you configured the MCP server - Click the Start button that appears above the server configuration
- Enter your credentials when prompted (stored securely for future use)
- Open
Verify Server Status:
- Open GitHub Copilot Chat (
Ctrl+Alt+I
/Cmd+Ctrl+I
) - Switch to Agent mode in the chat view
- Click the Tools button to view available MCP servers
- Confirm "Foxit Cloud API MCP Server" is listed and running
- Open GitHub Copilot Chat (
Making Your First Request
Once the server is running, you can interact with PDF tools through natural language in GitHub Copilot Chat:
@copilot /agent Convert this PDF to Word format
@copilot /agent combine foo.pdf and goo.pdf and name it something.pdf
@copilot /agent Compress the uploaded PDF
@copilot /agent Merge these PDF files
🔍 Troubleshooting
Common Issues
- Server fails to start: Check the "MCP Server Logs" in VS Code's Output panel
- Authentication errors: Verify your Client ID and Client Secret are correct
- Port conflicts: Ensure no other services are using the required ports
- Missing dependencies: Reinstall the package and check Python version
📄 License
This project is licensed under the MIT License.
⚠️ Security Notice
Only install MCP servers from trusted sources. Always review configurations before running to prevent unauthorized code execution.
Made with ❤️ by the Foxit development team
0
フォロワー
0
リポジトリ
0
Gist
0
貢献数