Turbo C MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TURBOC_BGI | No | BGI graphics drivers | C:\TURBOC3\BGI |
| TURBOC_LIB | No | Library search path | C:\TURBOC3\LIB |
| TCC_COMMAND | No | Compiler entry point (or a DOSBox .bat) | C:\TURBOC3\BIN\TCC.EXE |
| TURBOC_ROOT | No | Turbo C install root | C:\TURBOC3 |
| MCP_C_WORKROOT | No | Scratch directory for sessions | C:\TURBOC3\mcp_work |
| TURBOC_INCLUDE | No | Header search path | C:\TURBOC3\INCLUDE |
| MCP_C_TIMEOUT_MS | No | Per-run execution timeout in milliseconds | 5000 |
| MCP_C_RUN_COMMAND | No | Wrapper to launch the compiled .EXE (DOSBox bridge) | |
| MCP_C_MAX_OUTPUT_BYTES | No | Output cap returned to the model | 65536 |
| MCP_C_COMPILE_TIMEOUT_MS | No | Per-compile timeout in milliseconds | 10000 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| compile_and_runA | Compile C code with Borland Turbo C (TCC.EXE) and run the resulting DOS executable, capturing stdout/stderr, exit code, timing, and structured diagnostics. The everyday workhorse. |
| compile_checkA | Compile-only syntax/semantic check (no execution). Returns structured errors and warnings with line numbers — perfect for fast iteration and CI-style validation. |
| analyze_codeA | Static analysis of C source WITHOUT compiling: flags unsafe gets(), scanf-missing-&, assignment-in-if, unbalanced braces, missing main(), unchecked malloc, Turbo C float I/O pitfalls, and more. Instant, no toolchain required. |
| explain_errorA | Look up a Turbo C / Borland compiler, linker, or runtime message and get a plain-English cause + concrete fix. Feed it the raw error text (e.g. "Undefined symbol 'x' in function main"). |
| generate_asmA | Compile C to a Turbo C assembly listing (TCC -S) and return the generated .ASM. Great for teaching how C maps to 16-bit x86, inspecting codegen, or optimization study. |
| list_examplesB | Browse the built-in library of classic Turbo C programs (hello, Fibonacci, prime sieve, bubble sort, Towers of Hanoi, structs, file I/O, conio colors, BGI graphics, matrix multiply, number-guessing game, Pascal's triangle). Returns ids you can run. |
| get_exampleA | Return the full C source of a built-in example by id (see list_examples). |
| run_exampleA | Compile and run a built-in example by id in one shot (uses its sample stdin when defined). |
| benchmarkA | Compile once, then run the program N times (default 5) and report min/max/avg execution time in milliseconds. Useful for comparing algorithm variants on the real DOS runtime. |
| format_codeA | Reformat C source: re-indent by brace depth, tidy trailing whitespace, and collapse blank-line runs. Dependency-free; returns the formatted code. |
| environment_doctorA | Inspect the Turbo C toolchain: verify TCC.EXE, INCLUDE, LIB, and BGI paths, count available headers, report workspace sessions, and list any problems with fix hints. Run this first if compiles fail. |
| clean_workspaceA | Delete old scratch session directories created by compiles/runs. Optionally keep the N most recent. Frees disk and keeps the DOS work root tidy. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| debug-c-error | Diagnose and fix a Turbo C compile error, then verify with compile_check. |
| optimize-c | Optimize a C program for the 16-bit DOS target and benchmark before/after. |
| explain-program | Explain what a C program does, line by line, then run it to confirm. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Turbo C environment snapshot | Live toolchain health (same data as environment_doctor). |
| Example: Hello, Turbo C | The classic first program. |
| Example: Fibonacci sequence | Prints the first N Fibonacci numbers read from stdin. |
| Example: Sieve of Eratosthenes | Finds all primes up to 100 using a classic sieve. |
| Example: Bubble sort | Sorts a small integer array and prints each pass. |
| Example: Towers of Hanoi | Recursive solution that prints every disk move. |
| Example: Pascal's triangle | Prints a neat Pascal's triangle of a given height. |
| Example: Student records (structs) | Demonstrates structs, arrays of structs, and averages. |
| Example: File write & read | Writes a text file to disk then reads it back. |
| Example: Colorful console (conio.h) | Uses Borland's conio.h for colored text — the DOS classic. |
| Example: BGI graphics: bouncing colors | Opens the BGI VGA driver and draws concentric circles — the iconic Turbo C graphics demo. Requires EGAVGA.BGI. |
| Example: Matrix multiplication | Multiplies two 2x2 matrices and prints the result. |
| Example: Number guessing game | A tiny interactive game using rand(); feed guesses on stdin. |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BBSRGUY/turboc-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server