A FastMCP service that provides a comprehensive set of tools for interacting with the Solana blockchain. This MCP (Multi-Chain Protocol) service wraps Solana RPC API endpoints into easily accessible tools that can be integrated with AI assistants.
- Account information retrieval
- Token balance queries
- Program account management
- Block and transaction data access
- Epoch and network status information
- Stake account monitoring
- Supply and transaction statistics
- Python 3.10+
- Docker (for containerized deployment)
- Solana API endpoint URL
-
Clone the repository:
git clone <repository-url> cd demcp-ankr
-
Build the Docker image:
docker build -t demcp-ankr .
-
Run the container:
docker run -p 8080:8080 -e SOLANA_API_URL="<your-solana-api-url>" demcp-ankr
-
Install dependencies:
pip install -r requirements.txt
-
Set the Solana API URL environment variable:
export SOLANA_API_URL="<your-solana-api-url>"
-
Run the service:
python src/ankr.py
The service exposes the following Solana blockchain interaction tools:
get_account_info
- Retrieve detailed information about a Solana accountget_account_balance
- Check the SOL balance of an accountget_program_accounts
- Query token accounts, NFT data, or program statesget_token_account_balance
- Get the balance of a specific token accountget_token_accounts_by_owner
- List all token accounts owned by an addressget_blocks
- Retrieve block information for specific slotsget_epoch_schedule
- Get epoch scheduling informationget_latest_blockhash
- Retrieve the latest block hashget_minimum_balance_for_rent_exemption
- Calculate minimum balance for rent exemptionget_multiple_accounts
- Get information for multiple accounts simultaneouslyget_slot
- Retrieve the current slot numberget_stake_activation
- Get stake activation informationget_supply
- Retrieve total supply informationget_transaction_count
- Get the total transaction count
SOLANA_API_URL
: Required. The Solana RPC API endpoint URL.
This MCP service is designed to be integrated with AI assistants supporting the MCP protocol. The tools can be accessed through the standard MCP interface at port 8080.
- Never expose your API keys in the source code
- Use environment variables for sensitive configuration
- Consider implementing rate limiting for production deployments
MIT License
Copyright (c) 2023 DEMCP-ANKR
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We welcome contributions to the DEMCP-ANKR project!
-
Fork the Repository: Fork the repository to your GitHub account.
-
Clone the Forked Repository: Clone your fork locally on your machine.
git clone https://github.com/yourusername/demcp-ankr.git cd demcp-ankr
-
Create a Branch: Create a new branch for your feature or bug fix.
git checkout -b feature/your-feature-name
-
Make Changes: Implement your changes, adhering to the existing code style.
-
Test Your Changes: Ensure your changes don't break existing functionality.
-
Commit Your Changes: Commit with a clear and descriptive message.
git commit -m "Add feature: your feature description"
-
Push to GitHub: Push your changes to your forked repository.
git push origin feature/your-feature-name
-
Create a Pull Request: Open a pull request from your fork to the main repository.
- Follow PEP 8 style guidelines for Python code
- Write descriptive docstrings for all functions and classes
- Include appropriate error handling
- Add unit tests for new features
If you find a bug or have a suggestion for improvement:
- Check if the issue already exists in the GitHub issues
- If not, create a new issue with a descriptive title and detailed information
Thank you for contributing to make DEMCP-ANKR better!