NOVA MCP Server
A Model Context Protocol (MCP) server for NOVA secure file-sharing on NEAR blockchain. Enables AI assistants like Claude to interact with encrypted, decentralized file storage through natural language, providing seamless group-based access control, IPFS persistence, and TEE-secured keys via Shade Agents.
Features
π€ AI-Native Integration - Natural language interface for encrypted file operations
π AES-256-CBC Encryption - Client-side encryption exposed through MCP tools
π IPFS Storage - Decentralized file storage via Pinata
βοΈ NEAR Blockchain - Immutable transaction records and access control
π₯ Group Management - Fine-grained access control with member authorization
π TEE-Secured Keys - Off-chain key storage in Shade Agents (Phala TEEs) with ed25519 token auth
π Key Rotation - Automatic key rotation on member revocation via Shade events
π Composite Operations - High-level workflows for upload/retrieve
π¬ Conversational - Natural language commands for all NOVA operations
What is MCP?
The Model Context Protocol is an open standard that enables AI assistants to securely connect with external tools and data sources. MCP servers expose capabilities that AI models can use to perform actions on behalf of users.
NOVA's MCP server allows AI assistants to:
Encrypt and upload files to IPFS
Retrieve and decrypt files from IPFS
Manage blockchain-based access control groups
Record and query file transactions on NEAR
Fetch ephemeral keys from TEE-secured Shade Agents
Installation
Prerequisites
Python 3.10+
NEAR testnet account (create one)
Pinata API credentials (sign up)
Shade Agent API URL (from Phala cloud)
Install from PyPI (upcoming)
Install from Source
Configuration
Environment Variables
Create a .env file or set environment variables:
Claude Desktop Integration
Add to your Claude Desktop config file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
After updating the config, restart Claude Desktop.
Quick Start
Once configured, interact with NOVA through natural language in Claude:
Available Tools
The MCP server exposes 11 tools for AI assistants:
File Operations
composite_upload- Encrypt file (using Shade key), upload to IPFS, record transactioncomposite_retrieve- Fetch from IPFS and decrypt (using Shade key)ipfs_upload- Upload encrypted data to IPFSipfs_retrieve- Retrieve data from IPFS
Encryption
encrypt_data- AES-256-CBC encryptiondecrypt_data- AES-256-CBC decryption
Group Management
register_group- Create new access control group (auto-generates Shade key)add_group_member- Grant member accessrevoke_group_member- Revoke access and rotate Shade keyauth_status- Check user authorization
Key Management
get_shade_key- Retrieve ephemeral key from TEE-secured Shade Agent (token-gated)
Transaction Recording
record_near_transaction- Log file metadata on NEAR
Usage Examples
Example 1: Secure File Sharing
Example 2: Access Control
Example 3: File Retrieval
Example 4: High-Value Data Workflow
Core Concepts
Groups
Groups provide isolated access control domains. Each group has:
A unique identifier (
group_id)An owner (NEAR account) who manages membership
A TEE-secured encryption key (generated/rotated in Shade Agent)
A list of authorized members
Encryption Flow
Upload: Fetch ephemeral Shade key (token-gated) β Encrypt locally β Upload to IPFS β Record transaction
Download: Fetch ephemeral Shade key β Fetch from IPFS β Decrypt locally
Access Control
Only group owners can add/revoke members
Keys retrieved via signed tokens (ed25519, nonce/timestamp-gated) from TEE
Member revocation triggers automatic TEE key rotation
All operations logged on NEAR blockchain; Shade attestations verified on-chain
Security Considerations
β οΈ Important Security Notes:
Private Keys - Store NEAR private keys securely; never commit to version control
TEE Keys - Encryption keys stored encrypted in Shade TEEsβnever on-chain; access via attested tokens only
IPFS Privacy - IPFS content is public by CID; encryption + TEE gating essential
Key Rotation - Revoked members cannot decrypt files uploaded after revocation (TEE swap)
Local Decryption - Files are decrypted client-side; tokens expire post-use (replay-proof)
Attestation - Shade checksums verified on-chainβensures TEE integrity
NEAR Token Deposits
Some operations require NEAR token deposits for storage:
register_group- ~0.1 NEAR (includes Shade init)add_group_member- ~0.0005 NEARrevoke_group_member- ~0.0005 NEAR (includes Shade rotate)claim_token(internal) - ~0.001 NEARrecord_transaction- ~0.002 NEAR
Ensure your NEAR account has sufficient balance.
Development
Running Tests
Building from Source
MCP Inspector
Test the MCP server using the MCP Inspector:
Comparison with SDKs
Interface
Natural language
Programmatic API
Programmatic API
Use Case
AI assistants
Web/Node.js apps
System apps, smart contracts
Installation
pip install
npm install
cargo add
Encryption
Automatic
Manual control
Manual control
Integration
Claude Desktop
Any JS runtime
Any Rust project
Choose MCP for AI-assisted workflows, JS SDK for web applications, or Rust SDK for high-performance system integration.
Troubleshooting
MCP Server Not Connecting
Check Claude Desktop config path is correct
Verify all environment variables are set (incl. SHADE_API_URL)
Restart Claude Desktop after config changes
Check logs:
~/Library/Logs/Claude/mcp-*.log(MacOS)
NEAR Transaction Failures
Verify account has sufficient balance:
near state your-account.testnetCheck private key format:
ed25519:base58_encoded_keyEnsure contract ID is correct for network (testnet/mainnet)
Shade/TEE Issues
Verify SHADE_API_URL reachable (e.g., curl {SHADE_API_URL}/api/key-management/get_key)
Check checksum mismatches: Ensure update_checksum called post-gen
Token errors: Validate timestamp/nonce in payload; refresh if expired
IPFS Upload Failures
Verify Pinata API credentials are correct
Check file size limits (100MB default on free tier)
Ensure stable internet connection
Resources
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass (
pytest)Submit a pull request
License
This project is licensed under the MIT License - see LICENSE file for details.
Last updated