Skip to content

Commit 07de708

Browse files
committed
Forces unbuffered output (helpful on Windows)
1 parent 647d0e2 commit 07de708

3 files changed

Lines changed: 602 additions & 195 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "scantool"
3-
version = "0.12.0"
3+
version = "0.13.0"
44
description = "MCP server for multi-language code analysis with structure extraction, metadata parsing, and search capabilities across Python, JavaScript, TypeScript, Rust, Go, C/C++, Java, PHP, C#, Ruby, Zig, HTML, CSS, SCSS, Markdown, Swift, plain text, and images"
55
readme = "README.md"
66
requires-python = ">=3.11"
@@ -20,7 +20,7 @@ classifiers = [
2020
"Topic :: Software Development :: Libraries :: Python Modules",
2121
]
2222
dependencies = [
23-
"fastmcp>=2.12.4",
23+
"fastmcp>=2.14.4", # Includes stdio handling improvements
2424
"tree-sitter>=0.23.2",
2525
"tree-sitter-python>=0.23.6",
2626
"tree-sitter-javascript>=0.23.1",

src/scantool/__init__.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
"""File Scanner MCP - Beautiful file structure scanner with tree formatting."""
22

3-
__version__ = "0.1.0"
3+
import os
4+
import sys
5+
6+
# === Windows/stdio buffering fix ===
7+
# Prevents deadlocks when Claude Code sends parallel MCP requests over stdio.
8+
# Without this, stdout buffering on Windows can cause responses to get stuck.
9+
# See: https://github.com/jlowin/fastmcp/issues/1625
10+
os.environ.setdefault('PYTHONUNBUFFERED', '1')
11+
12+
if hasattr(sys.stdout, 'reconfigure'):
13+
sys.stdout.reconfigure(write_through=True) # type: ignore[union-attr]
14+
if hasattr(sys.stderr, 'reconfigure'):
15+
sys.stderr.reconfigure(write_through=True) # type: ignore[union-attr]
16+
17+
__version__ = "0.12.0"
418

519
from .server import main
620

0 commit comments

Comments
 (0)