Skip to content

Commit 422f8bc

Browse files
committed
更新README.md文档,修改requirements.txt和server.py,移除不需要的文件
1 parent deee18b commit 422f8bc

File tree

9 files changed

+546
-647
lines changed

9 files changed

+546
-647
lines changed

.npmignore

Lines changed: 0 additions & 37 deletions
This file was deleted.

README.md

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ A Model Context Protocol (MCP) service that provides PowerPoint translation capa
66

77
- Translate PowerPoint presentations to multiple languages
88
- Preserve formatting during translation
9-
- Support for multiple translation engines (Nova Lite and Claude)
9+
- Support for AWS Bedrock Nova models
1010
- Intelligent handling of proper nouns, brand names, and special content
11+
- Optimized MCP implementation with fallback support
1112

1213
## Supported Languages
1314

@@ -22,17 +23,24 @@ A Model Context Protocol (MCP) service that provides PowerPoint translation capa
2223

2324
## Prerequisites
2425

25-
- Node.js 14+ (for npm package installation)
2626
- Python 3.8+
2727
- AWS account with Bedrock access
2828
- AWS credentials configured
2929

3030
## Installation
3131

32-
### Using npm
32+
### Using pip (Python)
3333

3434
```bash
35-
npm install -g ppt-translator-mcp
35+
# Clone the repository
36+
git clone https://github.com/yourusername/mcpppttranslator.git
37+
cd mcpppttranslator
38+
39+
# Install dependencies
40+
pip install -r requirements.txt
41+
42+
# Or use the built-in helper
43+
python server.py --install-deps
3644
```
3745

3846
### Using Amazon Q Configuration
@@ -44,10 +52,10 @@ Add the following to your Amazon Q configuration:
4452
"ppt-translator": {
4553
"timeout": 60,
4654
"type": "stdio",
47-
"command": "npx",
55+
"command": "python",
4856
"args": [
49-
"-y",
50-
"ppt-translator-mcp@latest"
57+
"/path/to/mcpppttranslator/server.py",
58+
"--mcp"
5159
],
5260
"env": {
5361
"AWS_ACCESS_KEY_ID": "${AWS_ACCESS_KEY_ID}",
@@ -59,9 +67,24 @@ Add the following to your Amazon Q configuration:
5967
}
6068
```
6169

70+
### Direct Python Execution
71+
72+
You can also run the server directly using Python:
73+
74+
```bash
75+
# Run the server in MCP mode
76+
python server.py --mcp
77+
78+
# Or translate a file directly
79+
python server.py --translate --input-file presentation.pptx --target-language ja
80+
81+
# List supported languages
82+
python server.py --list-languages
83+
```
84+
6285
## Usage
6386

64-
Once the MCP server is running, you can use it with any MCP-compatible client like Amazon Q or Claude Desktop.
87+
Once the MCP server is running, you can use it with any MCP-compatible client like Amazon Q.
6588

6689
### Available Tools
6790

@@ -77,9 +100,22 @@ Once the MCP server is running, you can use it with any MCP-compatible client li
77100
## Example
78101

79102
```
80-
Translate my presentation.pptx to Japanese using the Claude model
103+
Translate my presentation.pptx to Japanese using the Nova model
81104
```
82105

106+
## Command Line Arguments
107+
108+
The server.py script supports the following command line arguments:
109+
110+
- `--mcp`: Run in MCP mode
111+
- `--translate`: Translate a PowerPoint file
112+
- `--input-file`: Path to the input PowerPoint file
113+
- `--target-language`: Target language code
114+
- `--output-file`: Path to save the translated file
115+
- `--model-id`: Translation model ID (choices: 'amazon.nova-micro-v1:0', 'amazon.nova-lite-v1:0')
116+
- `--list-languages`: List supported languages
117+
- `--install-deps`: Install required dependencies
118+
83119
## Development
84120

85121
### Local Development
@@ -92,25 +128,12 @@ Translate my presentation.pptx to Japanese using the Claude model
92128

93129
2. Install dependencies:
94130
```bash
95-
npm install
96131
pip install -r requirements.txt
97132
```
98133

99134
3. Run the server:
100135
```bash
101-
node index.js
102-
```
103-
104-
### Publishing to npm
105-
106-
1. Update version in package.json
107-
2. Login to npm:
108-
```bash
109-
npm login
110-
```
111-
3. Publish:
112-
```bash
113-
npm publish --access public
136+
python server.py --mcp
114137
```
115138

116139
## License

amazon-q-config-example.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

index.js

Lines changed: 0 additions & 110 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

publish.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
python-pptx>=0.6.21
22
boto3>=1.28.0
33
python-dotenv>=1.0.0
4+
mcp[cli]

0 commit comments

Comments
 (0)