-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add ALLOW_WRITE_OPERATIONS environment variable for write operation control #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9d2beb6
198eac7
70403da
7dece45
fdc6dfd
6cefa05
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,17 +47,17 @@ The server requires your Luno API key and secret. These can be obtained from you | |
|
|
||
| ## Available Tools | ||
|
|
||
| | Tool | Category | Description | | ||
| | ------------------- | ------------------- | ------------------------------------------------- | | ||
| | `get_ticker` | Market Data | Get current ticker information for a trading pair | | ||
| | `get_order_book` | Market Data | Get the order book for a trading pair | | ||
| | `list_trades` | Market Data | List recent trades for a currency pair | | ||
| | `get_balances` | Account Information | Get balances for all accounts | | ||
| | `create_order` | Trading | Create a new buy or sell order | | ||
| | `cancel_order` | Trading | Cancel an existing order | | ||
| | `list_orders` | Trading | List open orders | | ||
| | `list_transactions` | Transactions | List transactions for an account | | ||
| | `get_transaction` | Transactions | Get details of a specific transaction | | ||
| | Tool | Category | Description | Requires Write Operations | | ||
| | ------------------- | ------------------- | ------------------------------------------------- | ------------------------- | | ||
| | `get_ticker` | Market Data | Get current ticker information for a trading pair | No | | ||
| | `get_order_book` | Market Data | Get the order book for a trading pair | No | | ||
| | `list_trades` | Market Data | List recent trades for a currency pair | No | | ||
| | `get_balances` | Account Information | Get balances for all accounts | No | | ||
| | `create_order` | Trading | Create a new buy or sell order | **Yes** | | ||
| | `cancel_order` | Trading | Cancel an existing order | **Yes** | | ||
| | `list_orders` | Trading | List open orders | No | | ||
| | `list_transactions` | Transactions | List transactions for an account | No | | ||
| | `get_transaction` | Transactions | Get details of a specific transaction | No | | ||
|
|
||
| ## Examples | ||
|
|
||
|
|
@@ -203,12 +203,55 @@ This configuration will make VS Code run the Docker container. Ensure Docker is | |
|
|
||
| This tool requires API credentials that have access to your Luno account. Be cautious when using API keys, especially ones with withdrawal permissions. It's recommended to create API keys with only the permissions needed for your specific use case. | ||
|
|
||
| ### Write Operations Control | ||
|
|
||
| By default, the MCP server runs in **read-only mode** with write operations (`create_order` and `cancel_order`) disabled for security. To enable write operations, you must explicitly set the `ALLOW_WRITE_OPERATIONS` environment variable. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I know I put I guess https://github.com/benborla/mcp-server-mysql/ uses: "ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false"So maybe this is better to leave as is
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think I am also in favor more than just
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think users of our MCP server might not necessarily know what a tool is, if they are new to MCP. |
||
|
|
||
| #### Enabling Write Operations | ||
|
|
||
| Set the environment variable to one of the following values: | ||
| - `ALLOW_WRITE_OPERATIONS=true` | ||
| - `ALLOW_WRITE_OPERATIONS=1` | ||
| - `ALLOW_WRITE_OPERATIONS=yes` | ||
|
|
||
| ##### Docker Example: | ||
| ```bash | ||
| docker run --rm -i \ | ||
| -e "LUNO_API_KEY_ID=${LUNO_API_KEY_ID}" \ | ||
| -e "LUNO_API_SECRET=${LUNO_API_SECRET}" \ | ||
| -e "ALLOW_WRITE_OPERATIONS=true" \ | ||
| ghcr.io/luno/luno-mcp:latest | ||
| ``` | ||
|
|
||
| ##### VS Code Configuration: | ||
| ```json | ||
| { | ||
| "servers": { | ||
| "luno-docker": { | ||
| "command": "docker", | ||
| "args": [ | ||
| "run", "--rm", "-i", | ||
| "-e", "LUNO_API_KEY_ID=${input:luno_api_key_id}", | ||
| "-e", "LUNO_API_SECRET=${input:luno_api_secret}", | ||
| "-e", "ALLOW_WRITE_OPERATIONS=true", | ||
| "ghcr.io/luno/luno-mcp:latest" | ||
| ], | ||
| "inputs": [ | ||
| {"id": "luno_api_key_id", "type": "promptString", "description": "Luno API Key ID", "password": true}, | ||
| {"id": "luno_api_secret", "type": "promptString", "description": "Luno API Secret", "password": true} | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
Comment on lines
+217
to
+246
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than adding another example, I think we can add this new flag to the existing config declarations above. The flag explanation would probably be best to live there too 👍
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hear you, thought it best there because it speaks more to what this is which is Security Considerations. That said, could move the example up and just have the paragraph explaining the consideration.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's just a lot easier for users to read if we have a single config for each, with all the options. If users see the config above this one, they might not even know that Also want to keep the README as concise as possible
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes sense. |
||
|
|
||
| ### Best Practices for API Credentials | ||
|
|
||
| 1. **Create Limited-Permission API Keys**: Only grant the permissions absolutely necessary for your use case | ||
| 2. **Never Commit Credentials to Version Control**: Ensure `.env` files are always in your `.gitignore` | ||
| 3. **Rotate API Keys Regularly**: Periodically regenerate your API keys to limit the impact of potential leaks | ||
| 4. **Monitor API Usage**: Regularly check your Luno account for any unauthorized activity | ||
| 5. **Use Read-Only Mode by Default**: Only enable write operations when specifically needed | ||
|
|
||
| ### Contributing | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight preference for ✅ and ❌ over yes and no, but not that important to change 😄