Database · MODEL CONTEXT PROTOCOL
m4tyn0 influx mcp
MCP server for InfluxDB 1.8
WHAT IT CONNECTS
What m4tyn0 influx mcp gives an AI Agent
The source catalog does not include a structured feature list. Review the repository documentation before use.
SECURITY
An MCP listing is not a security review
An MCP server may receive model context, credentials, local files, or permission to call external systems. Review its code, requested environment variables, network behavior, package provenance, and maintenance status before connecting it to an agent.
README
Repository documentation
A Model Context Protocol (MCP) server that provides secure, read-only access to InfluxDB 1.8 via JWT authentication.
InfluxDB MCP Server allows AI assistants to query time-series data stored in InfluxDB through a standardized interface. It provides read-only access to your InfluxDB instance with authentication via JWT tokens.
- Docker
- InfluxDB 1.8 instance (already running)
- Credentials for your InfluxDB instance
-
Clone the repository:
git clone https://github.com/m4tyn0/influx_mcp cd influxdb-mcp-server -
Create a
.envfile with your configuration :cp env.example .env
INFLUXDB_HOST= INFLUXDB_PORT=8086 INFLUXDB_USERNAME= INFLUXDB_PASSWORD= INFLUXDB_SSL=false INFLUXDB_VERIFY_SSL=true INFLUXDB_TIMEOUT=10 JWT_SECRET= JWT_ALGORITHM=HS256 -
Build and run the Docker container:
docker build -t influxdb-mcp-server . docker run -d --env-file .env -p 8000:8000 influxdb-mcp-server
The server uses JWT tokens for authentication. You need to generate a token to authenticate with the MCP server, here is a simple script to do that:
import jwt
import datetime
# Create a token
payload = {
"sub": "username", # Replace with the username you want to identify with
"iat": datetime.datetime.utcnow(),
"exp": datetime.datetime.utcnow() + datetime.timedelta(hours=1)
}
token = jwt.encode(payload, "your-jwt-secret", algorithm="HS256")
print(token)Save this token for use with your MCP client.
-
Authenticate with the MCP server using the JWT token:
Tool: auth Arguments: {"token": "your.jwt.token.here"} -
Query your InfluxDB data:
Tool: list_databases Arguments: {}Tool: list_measurements Arguments: {"database": "your_database_name"}Tool: query Arguments: { "database": "your_database_name", "query": "SELECT * FROM measurement_name LIMIT 10" }
If you encounter issues:
-
Connection errors to InfluxDB:
- Verify the INFLUXDB_HOST is correct and accessible from the Docker container
- Check that your InfluxDB credentials are correct
- Ensure your InfluxDB instance is configured to accept connections from external hosts
-
Authentication issues:
- Verify your JWT_SECRET is set correctly
- Ensure the token you're using matches the JWT_SECRET and hasn't expired
- Check that your InfluxDB credentials have read access to the databases
-
Check logs:
docker logs
- The MCP server only allows read-only access to your InfluxDB instance
- All queries are validated to ensure they begin with SELECT
- JWT authentication protects access to the MCP server
- Consider running the server in a private network for additional security
Thank you for working with me. If you have any issues with the code, or want more things built, hit me up: m4tyn0@gmail.com
COMMUNITY