A fine-tuned Qwen3-8B model for autonomous MCP (Model Context Protocol) tool server generation. Given a natural language scenario description, the model generates a complete, runnable MCP server with tool schemas and implementation code.
Note: The coder-agent strategy dramatically improves all models by providing an iterative sandbox-based coding loop. The SFT model has not yet been evaluated with the coder-agent strategy.
Usage
fromtransformersimportAutoModelForCausalLM,AutoTokenizermodel_name="tool-genesis/Tool-Genesis-Qwen3-8B-SFT"tokenizer=AutoTokenizer.from_pretrained(model_name)model=AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto")prompt="""You are a developer building MCP tool servers in Python.
Build a complete MCP server for the following scenario:
A weather information service that provides current weather data,
forecasts, and weather alerts for any location worldwide.
Output only the Python source code using the FastMCP framework."""inputs=tokenizer(prompt,return_tensors="pt").to(model.device)outputs=model.generate(**inputs,max_new_tokens=4096,temperature=0.2)print(tokenizer.decode(outputs[0],skip_special_tokens=True))
Evaluation Protocol
The Tool-Genesis benchmark evaluates generated MCP servers across four levels:
Level
What it tests
L1: Protocol Compliance
JSON format validity and server launch success
L2: Semantic Correctness
Tool schema matching (F1) and unit test pass rate
L3: Capability Boundary
No unauthorized capabilities or dangerous extra tools
@misc{tool_genesis_2025,title={Tool-Genesis: A Task-Driven Tool Creation Benchmark for Self-Evolving Language Agent},author={Xia, Bowei and Hu, Mengkang and Wang, Shijian and Jin, Jiarui and Jiao, Wenxiang and Lu, Yuan and Li, Kexin and Luo, Ping},year={2025},note={Project page: https://tool-genesis.github.io}}