Enhance README with logo and badges; update documentation; modify read_only to False (#32)

This commit is contained in:
Haris
2025-05-21 13:49:41 +05:00
committed by GitHub
parent 7f8c2be2f4
commit 62b7e94344
4 changed files with 53 additions and 43 deletions

View File

@ -1,3 +1,11 @@
<p align="center">
<img src="assets/logo.svg" alt="Excel MCP Server Logo" width="300"/>
</p>
[![PyPI version](https://img.shields.io/pypi/v/excel-mcp-server.svg)](https://pypi.org/project/excel-mcp-server/)
[![PyPI downloads](https://img.shields.io/pypi/dm/excel-mcp-server.svg)](https://pypi.org/project/excel-mcp-server/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![MseeP.ai Security Assessment Badge](https://mseep.net/pr/haris-musa-excel-mcp-server-badge.png)](https://mseep.ai/app/haris-musa-excel-mcp-server)
# Excel MCP Server
@ -20,72 +28,48 @@ A Model Context Protocol (MCP) server that lets you manipulate Excel files witho
- Python 3.10 or higher
### Installation
1. Clone the repository:
```bash
git clone https://github.com/haris-musa/excel-mcp-server.git
cd excel-mcp-server
```
2. Install using uv:
```bash
uv pip install -e .
```
### Running the Server
The server supports two transport modes: stdio and SSE.
#### Using stdio transport (default)
#### Using stdio transport
Stdio transport is ideal for direct integration with tools like Cursor Desktop or local development, which can manipulate local files:
```bash
excel-mcp-server stdio
uvx excel-mcp-server stdio
```
#### Using SSE transport
SSE transport is perfect for web-based applications and remote connections, which manipulate remote files:
SSE transport is perfect for remote connections, which manipulate remote files:
```bash
excel-mcp sse
```
You can specify host and port for the SSE server:
```bash
excel-mcp sse --host 127.0.0.1 --port 8080
uvx excel-mcp-server sse
```
## Using with AI Tools
### Cursor IDE
1. Add this configuration to Cursor, choosing the appropriate transport method for your needs:
1. Add this configuration to your client, choosing the appropriate transport method for your needs:
**Stdio transport connection** (for local integration):
```json
{
"mcpServers": {
"excel-stdio": {
"command": "uv",
"args": ["run", "excel-mcp-server", "stdio"]
"command": "uvx",
"args": ["excel-mcp-server", "stdio"]
}
}
}
```
**SSE transport connection** (for web-based applications):
**SSE transport connection**:
```json
{
"mcpServers": {
"excel": {
"url": "http://localhost:8000/sse",
"env": {
"EXCEL_FILES_PATH": "/path/to/excel/files"
}
}
}
}
@ -93,25 +77,37 @@ excel-mcp sse --host 127.0.0.1 --port 8080
2. The Excel tools will be available through your AI assistant.
### Remote Hosting & Transport Protocols
## Environment Variables & File Path Handling
This server supports both stdio and SSE transport protocols for maximum flexibility:
### SSE Transport
1. **Using with Claude Desktop:**
- Use Stdio transport
When running the server with the **SSE protocol**, you **must set the `EXCEL_FILES_PATH` environment variable on the server side**. This variable tells the server where to read and write Excel files.
- If not set, it defaults to `./excel_files`.
2. **Hosting Your MCP Server (SSE):**
- [Remote MCP Server Guide](https://developers.cloudflare.com/agents/guides/remote-mcp-server/)
You can also set the `FASTMCP_PORT` environment variable to control the port the server listens on (default is `8000` if not set).
- Example (Windows PowerShell):
```powershell
$env:EXCEL_FILES_PATH="E:\MyExcelFiles"
$env:FASTMCP_PORT="8080"
uvx excel-mcp-server sse
```
- Example (Linux/macOS):
```bash
EXCEL_FILES_PATH=/path/to/excel_files FASTMCP_PORT=8080 uvx excel-mcp-server sse
```
## Environment Variables for SSE transport
### Stdio Transport
- `FASTMCP_PORT`: Server port for SSE transport (default: 8000)
- `EXCEL_FILES_PATH`: Directory for Excel files (default: `./excel_files`)
When using the **stdio protocol**, the file path is provided with each tool call, so you do **not** need to set `EXCEL_FILES_PATH` on the server. The server will use the path sent by the client for each operation.
## Available Tools
The server provides a comprehensive set of Excel manipulation tools. See [TOOLS.md](TOOLS.md) for complete documentation of all available tools.
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=haris-musa/excel-mcp-server&type=Date)](https://www.star-history.com/#haris-musa/excel-mcp-server&Date)
## License
MIT License - see [LICENSE](LICENSE) for details.

14
assets/logo.svg Normal file
View File

@ -0,0 +1,14 @@
<svg width="300" height="100" viewBox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" fill="none">
<rect width="600" height="200" fill="#0F172A" rx="20"/>
<g font-family="Arial, sans-serif" font-weight="bold" fill="#F8FAFC">
<text x="40" y="75" font-size="42" fill="#38BDF8">Excel</text>
<text x="180" y="75" font-size="42" fill="#FACC15">MCP</text>
<text x="290" y="75" font-size="42" fill="#4ADE80">Server</text>
</g>
<g transform="translate(40, 120)">
<rect x="0" y="0" width="30" height="30" fill="#38BDF8" rx="5"/>
<rect x="40" y="0" width="30" height="30" fill="#4ADE80" rx="5"/>
<rect x="80" y="0" width="30" height="30" fill="#FACC15" rx="5"/>
<text x="130" y="25" font-size="18" fill="#CBD5E1">Excel ops without Excel.</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 786 B

View File

@ -21,7 +21,7 @@ def read_excel_range(
) -> list[dict[str, Any]]:
"""Read data from Excel range with optional preview mode"""
try:
wb = load_workbook(filepath, read_only=True)
wb = load_workbook(filepath, read_only=False)
if sheet_name not in wb.sheetnames:
raise DataError(f"Sheet '{sheet_name}' not found")

View File

@ -67,7 +67,7 @@ def get_workbook_info(filepath: str, include_ranges: bool = False) -> dict[str,
if not path.exists():
raise WorkbookError(f"File not found: {filepath}")
wb = load_workbook(filepath, read_only=True)
wb = load_workbook(filepath, read_only=False)
info = {
"filename": path.name,