A Model Context Protocol (MCP) server for Okto Web3 integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Web3 transactions and portfolio through natural language interactions.
Create a Google Cloud Project and obtain credentials:
a. Create a Google Cloud Project:
b. Create OAuth 2.0 Credentials:
http://localhost:3000/oauth2callback
to the authorized redirect URIsgcp-oauth.keys.json
Set up Okto credentials:
Get these Okto credentials from https://dashboard.okto.tech/:
OKTO_ENVIRONMENT=sandbox
OKTO_CLIENT_PRIVATE_KEY=your_private_key
OKTO_CLIENT_SWA=your_swa
Run Authentication:
You can authenticate in two ways:
a. Global Authentication (Recommended):
# First time: Place gcp-oauth.keys.json in your home directory's .okto-mcp folder
mkdir -p ~/.okto-mcp
mv gcp-oauth.keys.json ~/.okto-mcp/
# Run authentication from anywhere
npx @okto_web3/okto-mcp-server@latest auth
b. Local Authentication:
# Place gcp-oauth.keys.json in your current directory
# The file will be automatically copied to global config
npx @okto_web3/okto-mcp-server@latest auth
The authentication process will:
gcp-oauth.keys.json
in the current directory or ~/.okto-mcp/
~/.okto-mcp/
~/.okto-mcp/credentials.json
Note:
- After successful authentication, credentials are stored globally in
~/.okto-mcp/
and can be used from any directory- Both Desktop app and Web application credentials are supported
- For Web application credentials, make sure to add
http://localhost:3000/oauth2callback
to your authorized redirect URIs
Add the following to your Claude Desktop configuration file (typically located at ~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
{
"mcpServers": {
"okto": {
"command": "node",
"env": {
"OKTO_ENVIRONMENT": "sandbox",
"OKTO_CLIENT_PRIVATE_KEY": "your_private_key_here",
"OKTO_CLIENT_SWA": "your_swa_here"
},
"args": [
"/path/to/okto-mcp-server/build/index.js"
]
}
}
}
Replace:
your_private_key_here
with your Okto client private keyyour_swa_here
with your Okto client SWA/path/to/okto-mcp-server
with the actual path where you installed the serverAlternatively, if you installed via npm:
{
"mcpServers": {
"okto": {
"command": "npx",
"env": {
"OKTO_ENVIRONMENT": "sandbox",
"OKTO_CLIENT_PRIVATE_KEY": "your_private_key_here",
"OKTO_CLIENT_SWA": "your_swa_here"
},
"args": [
"@okto_web3/okto-mcp-server@latest"
]
}
}
}
The server provides the following tools that can be used through Claude Desktop:
get-portfolio
)Retrieves detailed portfolio information including holdings and balances.
get-account
)Retrieves account details across multiple chains.
get-nft-collections
)Lists all NFT collections associated with the account.
get-orders-history
)Retrieves transaction history.
get-nft-portfolio
)Shows detailed NFT holdings information.
get-tokens
)Lists all available tokens and their details.
token-transfer
)Transfers tokens between addresses.
{
"amount": "1000000000000000000",
"recipient": "0x...",
"token": "0x...",
"caip2Id": "eip155:1"
}
get-chains
)Lists all supported blockchain networks.
~/.okto-mcp/
)OAuth Keys Not Found
gcp-oauth.keys.json
is in either your current directory or ~/.okto-mcp/
Invalid Credentials Format
web
or installed
credentialsPort Already in Use
Okto Authentication Failed
ISC
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Seamless access to top MCP servers powering the future of AI integration.