-
Notifications
You must be signed in to change notification settings - Fork 604
feat: Amazon Timestream for InfluxDB Local MCP Server #461
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
Conversation
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.
Can you add a "read-only" mode that disables the ability to delete and update unless --allow-writes
parameter is passed in? You can see an example of how that's managed in the Aurora DSQL MCP server: https://github.com/awslabs/mcp/blob/main/src/aurora-dsql-mcp-server/README.md
src/timestream-for-influxdb-mcp-server/awslabs/timestream_for_influxdb_mcp_server/server.py
Outdated
Show resolved
Hide resolved
src/timestream-for-influxdb-mcp-server/awslabs/timestream_for_influxdb_mcp_server/server.py
Show resolved
Hide resolved
src/timestream-for-influxdb-mcp-server/awslabs/timestream_for_influxdb_mcp_server/server.py
Show resolved
Hide resolved
src/timestream-for-influxdb-mcp-server/awslabs/timestream_for_influxdb_mcp_server/server.py
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #461 +/- ##
==========================================
+ Coverage 82.28% 82.34% +0.06%
==========================================
Files 298 300 +2
Lines 20583 21052 +469
Branches 3074 3152 +78
==========================================
+ Hits 16936 17336 +400
- Misses 2695 2711 +16
- Partials 952 1005 +53 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
``` % pre-commit run --show-diff-on-failure --color=always --all-files check for added large files..............................................Passed check that executables have shebangs.....................................Passed check illegal windows names..........................(no files to check)Skipped check json...............................................................Passed check for merge conflicts................................................Passed check that scripts with shebangs are executable..........................Passed check for broken symlinks............................(no files to check)Skipped check toml...............................................................Passed check xml............................................(no files to check)Skipped check non-mkdocs yaml....................................................Passed check mkdocs yaml........................................................Passed fix end of files.........................................................Passed detect destroyed symlinks................................................Passed detect private key.......................................................Passed detect aws credentials...................................................Passed forbid submodules....................................(no files to check)Skipped pretty format json.......................................................Passed trim trailing whitespace.................................................Passed ruff.....................................................................Passed ruff-format..............................................................Passed Detect secrets...........................................................Passed check license header.....................................................Passed ```
… documentation entry
``` % uv run --frozen pytest --cov --cov-branch --cov-report=term-missing ===================================================================================================================================================================================================== test session starts ===================================================================================================================================================================================================== platform darwin -- Python 3.10.18, pytest-8.4.0, pluggy-1.6.0 rootdir: /Users/lokendrp/workplace/ts/mcpserver-influx/mcp/src/timestream-for-influxdb-mcp-server configfile: pyproject.toml testpaths: tests plugins: anyio-4.9.0, mock-3.14.1, cov-6.1.1, asyncio-1.0.0 asyncio: mode=auto, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function collected 63 items tests/test_init.py .. [ 3%] tests/test_main.py .. [ 6%] tests/test_server.py ........................................................... [100%] ======================================================================================================================================================================================================= tests coverage ======================================================================================================================================================================================================== ______________________________________________________________________________________________________________________________________________________________________________________ coverage: platform darwin, python 3.10.18-final-0 ______________________________________________________________________________________________________________________________________________________________________________________ Name Stmts Miss Branch BrPart Cover Missing ---------------------------------------------------------------------------------------------------- awslabs/__init__.py 0 0 0 0 100% awslabs/timestream_for_influxdb_mcp_server/__init__.py 1 0 0 0 100% awslabs/timestream_for_influxdb_mcp_server/server.py 468 16 156 53 89% 231-232, 270, 332->334, 334->336, 336->338, 338->340, 340->342, 342->344, 344->346, 346->348, 348->350, 350->353, 353->357, 360-362, 413->415, 415->417, 417->419, 419->421, 421->423, 423->425, 425->427, 427->429, 429->432, 432->436, 439-441, 464->466, 466->469, 471, 492->494, 494->497, 520->522, 522->525, 682->684, 684->687, 811->813, 813->815, 815->817, 817->819, 819->822, 862->864, 864->866, 866->868, 868->870, 870->872, 872->874, 874->877, 921->931, 982->992, 1036->1038, 1038->1040, 1040->1044, 1047-1049, 1091, 1099->1104, 1104->1109, 1110, 1164 ---------------------------------------------------------------------------------------------------- TOTAL 469 16 156 53 89% ===================================================================================================================================================================================================== 63 passed in 0.90s ====================================================================================================================================================================================================== ```
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.
LGTM, a few items to consider in follow up PR(s):
- Consider adding timeouts for API calls
- Add retry mechanisms for transient failures
- Add rate limiting for API calls
- Limited validation of data points before writing to InfluxDB (we should validate measurement names, tag keys, and field values...)
- Add size limits for batch operations
- Limited validation of input parameters (we should validate URLs, port numbers, and other critical parameters and add type checking for numeric values)
* Amazon Timestream for InfluxDB Local MCP Server * Addressing comments * Test updates * Added tool descriptions * Minor fixes to code comments * Removing dummy passwords from mocked unit tests * Adding uv.lock file * Fixed pyright errors * Fixed License Headers * Fixing tests for pyright corrections * Increasing test coverage, fixing pre-commit errors ``` % pre-commit run --show-diff-on-failure --color=always --all-files check for added large files..............................................Passed check that executables have shebangs.....................................Passed check illegal windows names..........................(no files to check)Skipped check json...............................................................Passed check for merge conflicts................................................Passed check that scripts with shebangs are executable..........................Passed check for broken symlinks............................(no files to check)Skipped check toml...............................................................Passed check xml............................................(no files to check)Skipped check non-mkdocs yaml....................................................Passed check mkdocs yaml........................................................Passed fix end of files.........................................................Passed detect destroyed symlinks................................................Passed detect private key.......................................................Passed detect aws credentials...................................................Passed forbid submodules....................................(no files to check)Skipped pretty format json.......................................................Passed trim trailing whitespace.................................................Passed ruff.....................................................................Passed ruff-format..............................................................Passed Detect secrets...........................................................Passed check license header.....................................................Passed ``` * Adding a read-only mode to the tools with write privileges and fixing documentation entry * Adding tests for read-only mode ``` % uv run --frozen pytest --cov --cov-branch --cov-report=term-missing ===================================================================================================================================================================================================== test session starts ===================================================================================================================================================================================================== platform darwin -- Python 3.10.18, pytest-8.4.0, pluggy-1.6.0 rootdir: /Users/lokendrp/workplace/ts/mcpserver-influx/mcp/src/timestream-for-influxdb-mcp-server configfile: pyproject.toml testpaths: tests plugins: anyio-4.9.0, mock-3.14.1, cov-6.1.1, asyncio-1.0.0 asyncio: mode=auto, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function collected 63 items tests/test_init.py .. [ 3%] tests/test_main.py .. [ 6%] tests/test_server.py ........................................................... [100%] ======================================================================================================================================================================================================= tests coverage ======================================================================================================================================================================================================== ______________________________________________________________________________________________________________________________________________________________________________________ coverage: platform darwin, python 3.10.18-final-0 ______________________________________________________________________________________________________________________________________________________________________________________ Name Stmts Miss Branch BrPart Cover Missing ---------------------------------------------------------------------------------------------------- awslabs/__init__.py 0 0 0 0 100% awslabs/timestream_for_influxdb_mcp_server/__init__.py 1 0 0 0 100% awslabs/timestream_for_influxdb_mcp_server/server.py 468 16 156 53 89% 231-232, 270, 332->334, 334->336, 336->338, 338->340, 340->342, 342->344, 344->346, 346->348, 348->350, 350->353, 353->357, 360-362, 413->415, 415->417, 417->419, 419->421, 421->423, 423->425, 425->427, 427->429, 429->432, 432->436, 439-441, 464->466, 466->469, 471, 492->494, 494->497, 520->522, 522->525, 682->684, 684->687, 811->813, 813->815, 815->817, 817->819, 819->822, 862->864, 864->866, 866->868, 868->870, 870->872, 872->874, 874->877, 921->931, 982->992, 1036->1038, 1038->1040, 1040->1044, 1047-1049, 1091, 1099->1104, 1104->1109, 1110, 1164 ---------------------------------------------------------------------------------------------------- TOTAL 469 16 156 53 89% ===================================================================================================================================================================================================== 63 passed in 0.90s ====================================================================================================================================================================================================== ``` * Change read_only_mode flag to tool_write_mode * Updating README.md to index Timestream MCP server and CODEOWNERS file * mkdocs.yml entry for Timestream for InfluxDB server --------- Co-authored-by: alexa-perlov <56009415+alexa-perlov@users.noreply.github.com>
Fixes
Summary
Amazon Timestream for InfluxDB Local MCP Server
Changes
The MCP server allows for following tools:
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change? No
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.