SynapticLang is engineered from the ground up to be THE language for autonomous AI agents and trading bots. Unlike EVM/Solidity—which is riddled with unpredictable runtime reverts, dynamic memory exhaustion, and complex inheritance trees—SynapticLang is statically mapped and fully deterministic. For an AI agent, writing a SynapticLang contract means zero guessing: execution lanes are known at compile-time, there are no unhandled runtime exceptions, and gas costs are 100% fixed before deployment. If it compiles, it runs perfectly.
SynapticChain is a next-generation Layer-1 blockchain engineered entirely around a compiler-driven static scheduling paradigm. It is designed from the ground up for extreme throughput and enterprise financial messaging.
Rather than relying on runtime conflict resolution and std::sync::Mutex deadlocks on hot paths, the custom smart-contract language SynapticLang (.syn) enforces explicit compile-time state annotations (#[reads(...)], #[writes(...)]). This allows the network's S=0 parallel execution engine to statically route transactions across 256 completely lock-free concurrent memory lanes.
- Unrivaled Throughput: Benchmarked at 100,000+ TPS in mainnet configurations using the DAG-Primary multi-proposer SCBFT consensus (ADR-641).
- Sub-500ms Finality: Instant cross-border settlement speeds backed by robust Byzantine fault tolerance and rotating sequencer accountability.
- ISO 20022 Native: Built-in financial message primitives bridging standard SWIFT/pacs.008 traffic directly into on-chain
SwapEngineV3bODL pools. - Zero-Database Hotpaths: Complete removal of PostgreSQL/Redis bloat on validator nodes, utilizing bare-metal RocksDB/QMDB storage and raw
O_DIRECTNVMe paths. - Deterministic Disaster Recovery: 100% cryptographic state root parity across snapshot hardlink restores, enabling mesh-wide catastrophic recovery in under 15 seconds (ADR-643).
The SynapticLang MCP Server is not just a syntax checker—it is the Agentic Control Plane for the SynapticChain ecosystem. While its current capabilities excel at statically analyzing, generating, and compiling 100% bulletproof smart contracts, we are building it to interact with the entire network automatically.
- Live Network Telemetry & Execution: Agents will autonomously sign, batch (via
syn_sendTransactionBatch), and deploy contracts directly to the African Testnet mesh, seamlessly managing 256-lane nonce distribution (ADR-063). - Explorer & State Firehoses: Deep MCP integration with the
explorer-backend-v2Axum RPC APIs, allowing AI agents to perform live deterministic audits, check ODL pool reserves (/api/pools), and trace historical wallet routes instantly. - Automated SVAH Security Sweeps: Direct hooks into the SynapticChain Vulnerability Agentic Harness (SVAH) to automatically execute Red/Blue/Purple-team security sweeps against generated
.syncode before it ever touches a validator. - AgentFi & Tokenomics Operations: Native hooks for AI agents to spin up Polymarket-style prediction markets, Moltbook W3C Identity attestations, and issue $BOTCOIN or Carbon Credit tokens autonomously.
- Features
- What is SynapticLang?
- Installation
- Configuration
- Usage
- Features Overview
- Project Structure
- Development
- Troubleshooting
- Contributing
- License
- Resources
🚀 Rapid Development
- Pre-built contract templates for tokens, NFTs, DeFi, governance, and more
- Interactive contract builder with step-by-step guidance
- Boilerplate code generation for common patterns
📚 Language Expertise
- Comprehensive SynapticLang documentation access
- Syntax and semantic guidance
- Solidity comparison and migration help
✅ Code Quality
- Real-time contract validation
- Best practices enforcement
- Security vulnerability detection
- Anti-pattern identification
⚡ Gas Optimization
- Static gas cost analysis
- Worst-case gas computation
- Optimization suggestions with estimated savings
- Gas breakdown by operation type
🧪 Testing Support
- Unit test generation
- Property-based test scaffolding
- Test fixture creation
- Coverage analysis
🔧 Developer Tools
- Contract compilation to execution plans
- Error diagnosis with fix suggestions
- Documentation generation
- Code formatting
SynapticLang is a blockchain-specific programming language for SynapticChain featuring:
- Static Gas Computation - Gas costs calculated at compile time
- Explicit State Access - Functions declare reads/writes via annotations
- Bounded Loops - All loops require
#[max_iterations(N)] - Parallel Execution - Independent operations can run concurrently
- Type Safety - Strong typing with Result-based error handling
- Execution Plans - Compiler generates optimized execution schedules
This MCP server accelerates SynapticLang development by providing AI assistants with deep language knowledge and powerful development tools.
- Node.js 18.0.0 or higher
- npm (comes with Node.js)
- An MCP-compatible client (e.g., Claude Desktop, Cline, etc.)
Install via npm (when published):
npm install -g synapticlang-mcp-serverClone and build from source:
# Clone the repository
git clone https://github.com/synapticchain/synapticlang-mcp-server.git
cd synapticlang-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Verify installation
npm testAdd the server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"synapticlang": {
"command": "node",
"args": ["/absolute/path/to/synapticlang-mcp-server/dist/index.js"]
}
}
}If installed globally via npm:
{
"mcpServers": {
"synapticlang": {
"command": "synapticlang-mcp-server"
}
}
}After updating the configuration, restart Claude Desktop.
For other MCP clients (Cline, etc.), refer to their documentation for adding MCP servers. The general pattern is:
{
"command": "node",
"args": ["/path/to/synapticlang-mcp-server/dist/index.js"],
"env": {}
}Once configured, the MCP server provides tools that AI assistants can use to help with SynapticLang development. You can interact naturally with your AI assistant, and it will use these tools as needed.
The server exposes 12 powerful tools:
| Tool | Description |
|---|---|
query_language_docs |
Search SynapticLang documentation by topic |
list_templates |
List available contract templates with filtering |
get_template |
Retrieve and customize a specific template |
validate_contract |
Validate contract code for errors and best practices |
analyze_gas |
Analyze gas costs and suggest optimizations |
generate_code |
Generate boilerplate code for common patterns |
compile_contract |
Compile contracts to execution plans |
search_examples |
Search example contracts by use case or feature |
get_example |
Retrieve a complete example contract |
generate_tests |
Generate unit and property-based tests |
diagnose_error |
Diagnose errors and suggest fixes |
generate_documentation |
Generate documentation from contract code |
Ask your AI assistant:
"How do I declare state variables in SynapticLang?"
The assistant will use query_language_docs to retrieve relevant documentation with examples.
Ask your AI assistant:
"Show me an ERC20 token template"
The assistant will use list_templates and get_template to provide a complete, customizable token contract.
Ask your AI assistant:
"Validate this contract and check for issues"
contract MyToken {
state balances: Map<Address, u256>;
pub fn transfer(to: Address, amount: u256) {
self.balances[msg.sender] -= amount;
self.balances[to] += amount;
}
}The assistant will use validate_contract to identify missing annotations, lack of error handling, and other issues.
Ask your AI assistant:
"Analyze the gas costs of my contract and suggest optimizations"
The assistant will use analyze_gas to provide detailed gas breakdowns and optimization suggestions.
Ask your AI assistant:
"Generate a pausable pattern for my contract"
The assistant will use generate_code to create the necessary state variables, functions, and annotations.
Ask your AI assistant:
"Show me an example of a staking contract"
The assistant will use search_examples and get_example to provide a complete working example with tests and documentation.
Access 30+ pre-built templates across multiple categories:
- Tokens: ERC20, mintable, burnable, pausable, governance tokens
- NFTs: ERC721, marketplace, staking, royalties
- DeFi: AMM DEX, lending, staking, yield farming, flash loans
- Governance: DAO voting, timelock, multi-sig, quadratic voting
- Escrow: Payment escrow, dispute resolution, milestone payments
- Gaming: Item ownership, tournaments, loot boxes
- P2P: Peer payments, reputation systems, marketplaces
- Business: Supply chain, invoicing, subscriptions, loyalty programs
Each template includes:
- Complete, compilable contract code
- Deployment scripts
- Comprehensive test suites
- Gas cost estimates
- Security considerations
- Usage documentation
The validator checks for:
- Syntax Errors: Invalid SynapticLang syntax
- Annotation Errors: Missing or incorrect function annotations
- State Access Errors: Undeclared state reads/writes
- Loop Bound Errors: Missing
#[max_iterations]annotations - Type Errors: Type mismatches and invalid conversions
- Gas Inefficiencies: Suboptimal patterns that waste gas
- Security Issues: Common vulnerabilities
- Missing Validations: Missing
require!statements
Detailed gas analysis including:
- Static gas cost per function
- Worst-case gas for functions with loops
- Gas formulas for variable-length inputs
- Breakdown by operation type (reads: 20 gas, writes: 50 gas, events: 10 gas)
- Optimization opportunities with estimated savings
- Comparison with similar contract patterns
Generate boilerplate for:
- State variable declarations
- Event definitions
- Constructor (init) functions
- Getter and setter functions
- Access control patterns (owner, roles)
- Pausable patterns
- Property-based tests
All generated code includes:
- Correct function annotations
- Proper error handling
- Input validation
- Event emissions
- Gas-efficient patterns
synapticlang-mcp-server/
├── src/ # Source code
│ ├── index.ts # MCP server entry point
│ ├── tools/ # MCP tool handlers
│ │ ├── documentation.ts
│ │ ├── templates.ts
│ │ ├── validation.ts
│ │ ├── gas-analysis.ts
│ │ ├── code-generation.ts
│ │ ├── compilation.ts
│ │ ├── examples.ts
│ │ ├── testing.ts
│ │ └── documentation-gen.ts
│ ├── services/ # Core business logic
│ │ ├── language.ts
│ │ ├── template.ts
│ │ ├── validator.ts
│ │ ├── gas-analyzer.ts
│ │ ├── code-generator.ts
│ │ └── compiler.ts
│ ├── parser/ # SynapticLang AST parser
│ │ ├── lexer.ts
│ │ ├── parser.ts
│ │ └── ast.ts
│ ├── validation/ # Validation rules engine
│ │ ├── rules/
│ │ └── engine.ts
│ └── utils/ # Utility functions
├── data/ # Data files
│ ├── language/ # Language documentation
│ │ ├── types.json
│ │ ├── annotations.json
│ │ ├── control-flow.json
│ │ └── ...
│ ├── templates/ # Contract templates
│ │ ├── tokens/
│ │ ├── nfts/
│ │ ├── defi/
│ │ └── ...
│ └── examples/ # Example contracts
│ ├── tokens/
│ ├── nfts/
│ ├── defi/
│ └── ...
├── tests/ # Test files
├── dist/ # Build output (generated)
├── package.json # Node.js package configuration
├── tsconfig.json # TypeScript configuration
├── vitest.config.ts # Test configuration
├── DEVELOPMENT.md # Developer guide
└── README.md # This file
For detailed development instructions, see DEVELOPMENT.md.
# Install dependencies
npm install
# Run in watch mode (auto-recompile on changes)
npm run dev
# Run tests in watch mode
npm run test:watch
# Type check
npm run typecheck
# Run tests with coverage
npm run test:coveragenpm run build- Compile TypeScript to JavaScriptnpm run clean- Remove build artifactsnpm run dev- Watch mode for developmentnpm run typecheck- Type check without emitting filesnpm test- Run all tests oncenpm run test:watch- Run tests in watch modenpm run test:coverage- Run tests with coverage reportnpm start- Start the MCP server
The project uses Vitest for testing and targets 80%+ code coverage. Tests are located in the tests/ directory and alongside source files with .test.ts extensions.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage- Check configuration file path: Ensure you're editing the correct config file for your MCP client
- Verify absolute path: Use absolute paths in the configuration, not relative paths
- Check Node.js version: Ensure Node.js 18+ is installed (
node --version) - Rebuild the project: Run
npm run buildto ensure thedist/directory exists - Restart the client: Restart your MCP client after configuration changes
# Clean and rebuild
npm run clean
npm install
npm run build# Run tests with verbose output
npm test -- --reporter=verbose
# Run specific test file
npm test -- path/to/test.test.ts- "Cannot find module": Ensure you've run
npm run buildbeforenpm start - "Permission denied": Check file permissions on the dist directory
- Type errors: Run
npm run typecheckto see detailed type errors
- Check the DEVELOPMENT.md guide
- Review the issues page
- Join the SynapticChain community (links TBD)
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Write tests: Ensure 80%+ coverage for new code
- Run quality checks:
npm run typecheck npm test npm run test:coverage - Commit your changes: Use clear, descriptive commit messages
- Push to your fork:
git push origin feature/my-feature - Submit a pull request
- Follow the existing code style and conventions
- Write tests for all new features and bug fixes
- Update documentation for user-facing changes
- Ensure all tests pass and coverage meets requirements
- Add JSDoc comments for public APIs
- Keep commits focused and atomic
- Create template JSON in
data/templates/[category]/ - Include all required fields (code, deployment, tests, documentation)
- Test that the template compiles successfully
- Add to the template service
- Write tests for the template
- Update documentation
- Create rule class in
src/validation/rules/ - Implement the
ValidationRuleinterface - Add rule to the validation engine
- Write comprehensive tests
- Document the rule and its suggestions
This project is licensed under the MIT License - see the LICENSE file for details.
- SynapticLang Complete Primer
- SynapticChain Master Operator's Manual
- Development Guide
- MCP Protocol Documentation
- SynapticChain - The SynapticChain blockchain
- SynapticLang Compiler - The SynapticLang compiler
- SynapticChain SDKs - SDKs for multiple languages
- Website: synaptyx.xyz (TBD)
- Discord: Join our community (TBD)
- Twitter: @SynapticChain (TBD)
- Forum: forum.synaptyx.xyz (TBD)
- GitHub Issues - Bug reports and feature requests
- GitHub Discussions - Questions and discussions
Built with ❤️ by the SynapticChain Team
