8000 feat: Amazon Timestream for InfluxDB Local MCP Server by lokendrp-aws · Pull Request #461 · awslabs/mcp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 28 commits into from
Jun 11, 2025

Conversation

lokendrp-aws
Copy link
Contributor

Fixes

Summary

Amazon Timestream for InfluxDB Local MCP Server

Changes

The MCP server allows for following tools:

  • Create, update, list, describe, and delete Timestream for InfluxDB database instances
  • Create, update, list, describe, and delete Timestream for InfluxDB database clusters
  • Manage DB parameter groups
  • Tag management for Timestream for InfluxDB resources
  • Write and query data using InfluxDB's APIs

Checklist

If your change doesn't seem to apply, please leave them unchecked.

  • I have reviewed the contributing guidelines
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented

Is this a breaking change? No

RFC issue number:

Checklist:

  • Migration process documented: N/A
  • Implement warnings (if it can live side by side): N/A

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.

@lokendrp-aws lokendrp-aws requested review from a team as code owners May 29, 2025 22:23
@scottschreckengaust scottschreckengaust added hold-merging Signals to hold the PR from merging new mcp server A new MCP server ideally linked to an issue labels May 29, 2025
@lokendrp-aws lokendrp-aws changed the title Amazon Timestream for InfluxDB Local MCP Server feat: Amazon Timestream for InfluxDB Local MCP Server May 30, 2025
Copy link
Contributor
@alexa-perlov alexa-perlov left a 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

@alexa-perlov alexa-perlov self-assigned this Jun 3, 2025
Copy link
codecov bot commented Jun 6, 2025

Codecov Report

Attention: Patch coverage is 85.28785% with 69 lines in your changes missing coverage. Please review.

Project coverage is 82.34%. Comparing base (22361de) to head (662588d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...slabs/timestream_for_influxdb_mcp_server/server.py 85.25% 16 Missing and 53 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-advanced-security
Copy link

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.

alexa-perlov and others added 4 commits June 8, 2025 15:25
```
% 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
```
lokendrp-aws and others added 8 commits June 9, 2025 16:12
```
% 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 ======================================================================================================================================================================================================
```
Copy link
Contributor
@krokoko krokoko left a 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)

@alexa-perlov alexa-perlov added this pull request to the merge queue Jun 11, 2025
@alexa-perlov alexa-perlov removed the hold-merging Signals to hold the PR from merging label Jun 11, 2025
Merged via the queue into awslabs:main with commit 46a0b8d Jun 11, 2025
92 of 93 checks passed
tenzingsherpaa pushed a commit to tenzingsherpaa/mcp that referenced this pull request Jun 18, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new mcp server A new MCP server ideally linked to an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0