A file parser using Kimi AI
Project description
MCP File Parser
A file parser using Kimi AI. However, all of this is free.
Installation
pip install mcp-fileparser
Usage
As a Python Library
-
Set up your environment variables.
Create a
.envfile in your project root and add your Kimi API key:KIMI_API_KEY="your_api_key" -
Use the
parse_filefunction.from mcp_fileparser import parse_file content = parse_file("/path/to/your/file.xlsx") print(content)
As an MCP Server
This package can also be used as an MCP (Model Context Protocol) server, providing file parsing capabilities to MCP clients.
Installation
-
Install the package:
pip install mcp-fileparser
-
Set up your environment variables:
Create a
.envfile in your project root and add your Kimi API key:KIMI_API_KEY="your_api_key"
Configuration
Add the MCP server to your MCP client configuration. For example, in Claude Desktop or other MCP-compatible clients:
{
"mcpServers": {
"mcp-fileparser": {
"command": "npx",
"args": [
"--from",
"mcp-fileparser",
"parse_file"
],
"env": {
"KIMI_API_KEY": "your_api_key"
}
}
}
}
Available Tools
Once connected, the MCP server provides the following tool:
parse_file: Parse a file and extract its content using Kimi AI- Parameters:
fpath(string): The path to the file you want to parse
- Returns: The extracted content as a string
- Parameters:
Example Usage
In an MCP-compatible client, you can use the parse_file tool like this:
# Example of how the tool would be called by an MCP client
result = await client.call_tool("parse_file", {
"fpath": "/path/to/your/document.pdf"
})
print(result.content)
Supported File Types
The file parser supports various file types including:
- PDF documents
- Word documents (.docx)
- Excel spreadsheets (.xlsx)
- Text files (.txt)
- And many other formats supported by Kimi AI
Running the Server Manually
You can also run the MCP server manually for testing:
# Set your API key
export KIMI_API_KEY="your_api_key"
# Run the server
fileparser
The server will start and listen for MCP connections via stdio transport.
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_fileparser-0.1.3.tar.gz.
File metadata
- Download URL: mcp_fileparser-0.1.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc92cbb60a68ac29f87bb569f51af613df5477a54010f5b82066282c83a25729
|
|
| MD5 |
5020392bc34b33a861fec1516982ee1e
|
|
| BLAKE2b-256 |
77da9fcb1603d4fa3be702135ebea89dda6ee931a2b3b99da0901cedc031f659
|
File details
Details for the file mcp_fileparser-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mcp_fileparser-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0057a3b4002d4f11cde36cc3e29d99c9223f0c87ec7d6cd4e97a474d3c5e40cd
|
|
| MD5 |
94ede15f4e98906020a66f7ab8248cd9
|
|
| BLAKE2b-256 |
7e9b2acf7c11dc025bc93e0ef32d7fed93ab56ee1945d265fa1bc08fa545dc51
|