bst-avl-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bst-avl-mcp Insert 3, 1, 2 into AVL tree and visualize rotations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Educational MCP server to learn BST & AVL trees
A Model Context Protocol (MCP) server designed to help you learn and visualize Binary Search Trees (BST) and AVL Trees. This project implements these data structures in TypeScript, demonstrating core algorithms like insertion, deletion, and AVL rotations.
Features
Binary Search Tree (BST): Standard implementation.
AVL Tree: Self-balancing binary search tree with automatic rotations (Left, Right, Left-Right, Right-Left).
Visualization: Tools to print the tree structure to the console/client to see how it changes after operations.
Educational Tools: Explicitly designed to help users "hand trace" or visualize specific tree states.
Related MCP server: GitViz MCP
Installation
Clone the repository.
Install dependencies:
npm install
Usage
Building the Server
Compile the TypeScript code:
npm run buildRunning the Server
Start the MCP server (stdio transport):
npm startRunning Verification Tests
Run the included test script which demonstrates a sequence of insertions and rotations (based on a classic hand-tracing example):
npm testUsing with Claude Desktop
To use this server with the Claude Desktop app, add the following configuration to your claude_desktop_config.json file:
{
"mcpServers": {
"bst-avl": {
"command": "node",
"args": [
"/YourDirectory/bst-avl-mcp/build/index.js"
]
}
}
}Note: Update the path to match your project location.
Available Tools
reset_tree: Resets the specified tree (bstoravl) to be empty.insert_node: Inserts a number into the tree and returns the new visual structure.delete_node: Deletes a number from the tree and maintains balance (for AVL).search_node: Checks if a number exists in the tree.print_tree: Returns a string representation of the current tree hierarchy.
Project Structure
src/bst.ts: Basic BST implementation.src/avl.ts: AVL Tree implementation with rotation logic.src/index.ts: MCP Server entry point.src/types.ts: Shared TypeScript interfaces.
Available Tools
5 toolsdelete_nodeC
Delete a key from the specified tree.
Inputs: key (required), treeType (required).
insert_nodeC
Insert a key into the specified tree.
Inputs: key (required), treeType (required).
print_treeB
Get a visual representation of the tree structure.
Inputs: treeType (required).
reset_treeA
Reset the specified tree (bst or avl) to be empty.
Inputs: treeType (required).
search_nodeC
Search for a key in the specified tree.
Inputs: key (required), treeType (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool performs a distinct operation on the tree: reset, insert, delete, search, and print. No two tools overlap in purpose, making selection unambiguous.
All tool names follow a consistent verb_noun pattern (reset_tree, insert_node, delete_node, search_node, print_tree). The convention is predictable and easy to read.
Five tools are well-scoped for a BST/AVL tree server, covering the essential operations without bloat. Each tool clearly earns its place.
The surface covers the core lifecycle: reset, insert, delete, search, and visualize. Minor gaps exist for auxiliary queries like tree height, size, or traversal order, but these are not essential for basic tree manipulation.
Maintenance
Related MCP Connectors
Interactive diagrams you can collapse, regroup and focus: architecture, dependencies, org charts
Flowcharts, UML/ER diagrams, mind maps, infographics and SOPs as editable, presentable boards
Animated, step-by-step diagrams: learn the format, validate a diagram and get a link to watch it.
Interactive Databricks learning, certification practice and sourced engineering guidance.
Related MCP Servers
- AlicenseCqualityDmaintenanceDeep directory tree visualization tool enabling efficient visualization of complex directory structures with AI-powered analysis capabilities.114 npm14MIT
- AlicenseNot gradedqualityCmaintenanceVisualizes Git history and commit logs with before/after animations for operations like merge, rebase, and cherry-pick. Integrates with AI assistants to provide Git analysis tools and smart command suggestions through natural language.1MIT
- AlicenseBqualityDmaintenanceTransforms markdown documents into immersive 3D visualizations using semantic analysis and spatial layout, enabling navigable knowledge structures.72ISC
- FlicenseAqualityDmaintenanceInteractive algorithm coach MCP server that provides guided practice, local code execution, and real-world engineering case mapping for 45 algorithm topics.7-