Create a new MCP server (apps/wallet-server) for the Truvera Wallet SDK using @docknetwork/wallet-sdk-web package. The server will enable Claude to interact with a cloud wallet for credential management, DID operations, and verification workflows.
Goal: Move reusable MCP server code to a shared location accessible by both servers.
Tasks:
- Create
packages/mcp-shared/directory for shared code - Extract transport layer to
packages/mcp-shared/src/transport/stdio/index.ts- stdio transport implementationhttp/index.ts- HTTP streaming transport implementationtypes.ts- transport type definitions
- Extract tool system to
packages/mcp-shared/src/tools/types.ts- ToolDef, ToolHandler, ToolResult interfacesutils.ts- formatResult and other utilitiescomposeTools.ts- Generic tool composition helpers
- Extract build info types to
packages/mcp-shared/src/types/build-info.ts- BuildInfo interface
- Create
packages/mcp-shared/package.jsonwith proper exports - Update
apps/truvera-api/to import from shared package - Update root
package.jsonworkspaces configuration
Files to Create:
packages/
└── mcp-shared/
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts
│ ├── transport/
│ │ ├── index.ts
│ │ ├── stdio/
│ │ │ └── index.ts
│ │ ├── http/
│ │ │ └── index.ts
│ │ └── types.ts
│ ├── tools/
│ │ ├── index.ts
│ │ ├── types.ts
│ │ └── utils.ts
│ └── types/
│ ├── index.ts
│ └── build-info.ts
└── README.md
Estimated Effort: 4-6 hours
Goal: Abstract common server initialization logic.
Tasks:
- Create
packages/mcp-shared/src/server/directory - Extract server setup logic into reusable function
- Accept: server name, version, tools, handlers, transport config
- Handle: ListTools, CallTool request handlers
- Return: configured MCP server instance
- Add configuration types for server options
- Document server bootstrap API
Files to Create:
packages/mcp-shared/src/server/
├── index.ts
├── bootstrap.ts
├── types.ts
└── handlers.ts
Estimated Effort: 3-4 hours
Goal: Understand the full API surface of @docknetwork/wallet-sdk-web.
Key Modules Identified:
createWallet({ dataStore })- Initialize walletwallet.deleteWallet()- Remove walletwallet.addDocument(doc)- Add documentwallet.getAllDocuments()- Get all docswallet.getDocumentById(id)- Get specific docwallet.getDocumentsByType(type)- Filter by typewallet.updateDocument(doc)- Update docwallet.removeDocument(id)- Remove docwallet.exportDocuments({ documents, password })- Export encryptedwallet.exportUniversalWalletJSON(password)- Export full wallet
generateCloudWalletMasterKey()- Generate key & mnemonicrecoverCloudWalletMasterKey(mnemonic)- Recover from mnemonicinitializeCloudWallet({ dataStore, edvUrl, authKey, masterKey })- Initialize cloud syncpullDocuments()- Sync from cloudenrollUserWithBiometrics(edvUrl, authKey, biometric, userId)- Biometric enrollmentauthenticateWithBiometrics(edvUrl, authKey, biometric, userId)- Biometric auth
createDIDProvider({ wallet })- Create providerdidProvider.getDefaultDID()- Get default DIDdidProvider.createDID()- Create new DIDdidProvider.getDIDs()- List all DIDs
createCredentialProvider({ wallet })- Create providercredentialProvider.importCredentialFromURI({ uri, didProvider })- Import credentialcredentialProvider.getCredentials()- List credentials
createMessageProvider({ wallet, didProvider })- Create providermessageProvider.fetchMessages()- Fetch DIDComm messagesmessageProvider.processDIDCommMessages()- Process messages
createVerificationController({ wallet })- Create controllercontroller.start({ template })- Start verificationcontroller.selectedCredentials.set(id, { credential, attributesToReveal })- Select credentialscontroller.createPresentation()- Build presentationcontroller.submitPresentation(presentation)- Submit for verification
Goal: Define MCP tools for each wallet operation.
create_wallet- Initialize a new walletdelete_wallet- Remove wallet and all dataexport_wallet- Export encrypted wallet backupimport_wallet- Import wallet from backupget_wallet_status- Check wallet initialization status
add_document- Add document to walletget_document- Retrieve document by IDlist_documents- List all documents (with type filter)update_document- Update existing documentdelete_document- Remove document from wallet
generate_master_key- Generate new cloud wallet keyrecover_master_key- Recover key from mnemonicinitialize_cloud_wallet- Initialize cloud syncsync_from_cloud- Pull documents from EDVenroll_biometric- Enroll biometric authenticationauthenticate_biometric- Authenticate with biometric
get_default_did- Get wallet's default DIDcreate_did- Generate new DIDlist_dids- List all DIDs in wallet
import_credential- Import credential from offer URIlist_credentials- Get all credentials in walletget_credential- Get specific credential by ID
fetch_messages- Fetch DIDComm messagesprocess_messages- Process pending messages
start_verification- Initialize verification flowselect_credentials_for_presentation- Choose credentials to revealcreate_presentation- Build verifiable presentationsubmit_presentation- Submit presentation to verifier
Estimated Effort: 6-8 hours for analysis and design
Goal: Create basic project structure for wallet server.
Tasks:
- Create
apps/wallet-server/directory - Setup package.json with dependencies
@docknetwork/wallet-sdk-web@docknetwork/wallet-sdk-core@docknetwork/wallet-sdk-data-store-web@modelcontextprotocol/sdk- Reference
mcp-sharedpackage
- Create tsconfig.json
- Setup build scripts
- Create Dockerfile
- Add environment variable configuration
Files to Create:
apps/wallet-server/
├── package.json
├── tsconfig.json
├── Dockerfile
├── .env.example
├── .dockerignore
├── README.md
└── src/
└── index.ts
Environment Variables:
EDV_URL- Encrypted Data Vault URL (default: https://edv.dock.io)EDV_AUTH_KEY- EDV authentication keyWALLET_NETWORK- Network ID (testnet/mainnet)MCP_MODE- Transport mode (stdio/http)MCP_PORT- HTTP port (when MODE=http)
Estimated Effort: 2-3 hours
Goal: Implement feature-based architecture like truvera-api.
Tasks:
-
Create feature modules following plugin pattern:
src/features/ ├── wallet/ # Core wallet operations ├── cloud-wallet/ # Cloud sync operations ├── dids/ # DID management ├── credentials/ # Credential management ├── messages/ # DIDComm messaging ├── verification/ # Presentation/verification └── shared/ # Shared types and utilities -
Each feature exports:
client.ts- API client wrappertools.ts- Tool definitions and handlerstypes.ts- TypeScript interfacesschemas.ts- JSON Schema definitionsindex.ts- Public exports
Estimated Effort: 2-3 hours for structure
Goal: Implement wallet initialization and state management.
Tasks:
- Create
src/features/wallet/client.ts- WalletClient class
- Initialize data store
- Create/destroy wallet
- Export/import operations
- Create persistent wallet state manager
- Implement tool handlers
- create_wallet
- delete_wallet
- export_wallet
- import_wallet
- get_wallet_status
File: src/features/wallet/client.ts
export class WalletClient {
private dataStore: DataStore | null = null;
private wallet: IWallet | null = null;
async initialize(): Promise<void>
async createWallet(): Promise<WalletInfo>
async deleteWallet(): Promise<void>
async exportWallet(password: string): Promise<string>
async importWallet(data: string, password: string): Promise<void>
async getStatus(): Promise<WalletStatus>
}Estimated Effort: 4-6 hours
Goal: Implement cloud sync and key management.
Tasks:
- Create
src/features/cloud-wallet/client.ts- CloudWalletClient class
- Master key generation
- Mnemonic recovery
- Cloud initialization
- Document synchronization
- Biometric operations
- Implement tool handlers
- generate_master_key
- recover_master_key
- initialize_cloud_wallet
- sync_from_cloud
- enroll_biometric
- authenticate_biometric
Estimated Effort: 6-8 hours
Goal: Implement DID management operations.
Tasks:
- Create
src/features/dids/client.ts- DIDClient class wrapping DIDProvider
- DID creation
- DID listing
- Default DID management
- Implement tool handlers
- get_default_did
- create_did
- list_dids
Estimated Effort: 3-4 hours
Goal: Implement credential import and management.
Tasks:
- Create
src/features/credentials/client.ts- CredentialClient class wrapping CredentialProvider
- Import from OpenID credential offers
- Credential listing
- Credential retrieval
- Implement tool handlers
- import_credential
- list_credentials
- get_credential
Estimated Effort: 4-5 hours
Goal: Implement DIDComm messaging.
Tasks:
- Create
src/features/messages/client.ts- MessageClient class wrapping MessageProvider
- Fetch messages for DIDs
- Process DIDComm messages
- Implement tool handlers
- fetch_messages
- process_messages
Estimated Effort: 3-4 hours
Goal: Implement verification and presentation flows.
Tasks:
- Create
src/features/verification/client.ts- VerificationClient class wrapping VerificationController
- Verification initialization
- Credential selection
- Presentation creation
- Presentation submission
- Implement tool handlers
- start_verification
- select_credentials_for_presentation
- create_presentation
- submit_presentation
Estimated Effort: 5-6 hours
Goal: Compose all feature tools into server.
Tasks:
- Create
src/tools/composeTools.ts- Import all feature tool definitions
- Merge tool lists
- Build handler map
- Schema resolution (if needed)
- Create main server entry point
src/index.ts- Initialize clients
- Build tools and handlers
- Bootstrap MCP server using shared infrastructure
- Handle transport selection (stdio/http)
Estimated Effort: 3-4 hours
Tasks:
- Create test structure mirroring source
- Write unit tests for each client class
- Mock wallet SDK dependencies
- Test tool handlers in isolation
Estimated Effort: 8-10 hours
Tasks:
- Test wallet lifecycle (create, use, destroy)
- Test cloud sync flow
- Test credential import flow
- Test verification flow
- Test with real EDV (testnet)
Estimated Effort: 6-8 hours
Tasks:
- Create comprehensive README for wallet-server
- Setup instructions
- Environment configuration
- Tool usage examples
- Cloud wallet setup guide
- Document each tool with examples
- Update root README
- Update copilot-instructions.md
Estimated Effort: 4-5 hours
Tasks:
- Create optimized Dockerfile
- Add wallet-server to docker-compose.yml
- Test container build
- Document container usage
Estimated Effort: 2-3 hours
Tasks:
- Add wallet-server to GitHub Actions workflow
- Add build/test jobs
- Add lint checks
- Update badge in README
Estimated Effort: 2-3 hours
Tasks:
- Add build:wallet task to tasks.json
- Add dev:wallet task to tasks.json
- Add debug configuration to launch.json
- Update .vscode/mcp.json for local testing
Estimated Effort: 1-2 hours
- Phase 1 (Refactoring): 7-10 hours
- Phase 2 (Analysis): 6-8 hours
- Phase 3 (Implementation): 30-40 hours
- Phase 4 (Testing/Docs): 18-23 hours
- Phase 5 (Deployment): 5-8 hours
Grand Total: 66-89 hours (~2-3 weeks of development)
- Phase 1.1 - Extract shared infrastructure (Day 1-2)
- Phase 1.2 - Create server bootstrap (Day 2-3)
- Phase 3.1 - Project scaffold (Day 3)
- Phase 3.2 - Feature structure (Day 4)
- Phase 3.3 - Core wallet client (Day 4-5)
- Phase 3.4 - Cloud wallet client (Day 6-7)
- Phase 3.5 - DID client (Day 8)
- Phase 3.6 - Credential client (Day 8-9)
- Phase 3.7 - Message client (Day 9)
- Phase 3.8 - Verification client (Day 10)
- Phase 3.9 - Tool composition (Day 11)
- Phase 4.1 - Unit tests (Day 11-12)
- Phase 4.2 - Integration tests (Day 13)
- Phase 4.3 - Documentation (Day 13-14)
- Phase 5 - Deployment setup (Day 14-15)
-
Shared Core, Custom Features
- Transport, tool system, and server bootstrap are shared
- Feature modules are app-specific
- Each server can have unique client implementations
-
Plugin Architecture
- Each feature is self-contained
- Features export tools and handlers independently
- Easy to add/remove features
-
Type Safety
- Full TypeScript throughout
- JSON Schema for tool validation
- Proper interface definitions
-
Stateful Operation
- Unlike truvera-api (stateless REST calls), wallet-server maintains state
- Need wallet lifecycle management
- Consider persistence between restarts
-
Security Considerations
- Master keys should not be logged
- Mnemonics are sensitive
- EDV auth keys must be secured
- Consider encryption at rest for local state
-
Wallet Persistence: State stored in cloud wallet (EDV). Master key passed as env var at runtime.
-
Multi-Wallet Support: Single wallet per server instance.
-
Storage: Cloud storage only (EDV) - automatic synchronization.
-
Feature Priority: DIDs → Credentials → DIDComm messaging.
-
Timeline: Fast iteration, working together in bite-sized chunks.
Based on decisions above, we'll skip these features for MVP:
- ❌ Local-only wallet operations (no cloud sync)
- ❌ Biometric authentication (requires platform APIs)
- ❌ Document management (focus on credentials only)
- ❌ Manual export/import (cloud handles persistence)
- ❌ Verification/presentation tools (add later)
Focus on:
- ✅ Cloud wallet initialization with master key
- ✅ DID management (create, list, get default)
- ✅ Credential management (import, list, get)
- ✅ DIDComm messaging (fetch, process)
# Cloud Wallet Configuration
EDV_URL=https://edv.dock.io # Encrypted Data Vault URL
EDV_AUTH_KEY=your-edv-auth-key # EDV authentication key
WALLET_MASTER_KEY=your-master-key-here # Master key for cloud wallet
# OR provide mnemonic instead:
WALLET_MNEMONIC=your twelve word mnemonic... # BIP39 mnemonic to derive master key
# Optional
WALLET_NETWORK=testnet # Network ID (testnet/mainnet)
MCP_MODE=stdio # Transport mode (stdio/http)
MCP_PORT=3000 # HTTP port (when MODE=http)Ready to start Phase 1: Extract shared infrastructure to prepare for wallet server implementation.
Proceeding with fast, iterative implementation in this order:
- Phase 1.1-1.2: Shared infrastructure (4-6 hours)
- Phase 3.1-3.2: Wallet server scaffold (2-3 hours)
- Phase 3.5: DID client (3-4 hours)
- Phase 3.6: Credential client (4-5 hours)
- Phase 3.7: Message client (3-4 hours)
- Testing & iteration