MCP Tools with Dependent Types: A Defold Editor Experiment

2025-08-18

This post details an experiment using a Large Language Model (LLM) within the Defold game editor. The author initially attempted to use Claude to directly manipulate Lua code, but faced low accuracy. The proposed solution involved using JSON Schemas to define tool inputs, but this ran into a limitation: the inability to implement dependent types within the Model-Code-Prompt (MCP) framework. This means the structure of tool input depends on runtime information. For example, editing 3D models requires different properties depending on the chosen material. The solution is a two-step process: the LLM selects a resource, the program looks up its data structure and constructs a JSON Schema; then, the LLM uses this schema to generate edits. The author suggests MCP should support dependent types to handle complex data more effectively.

Read more
Development

LSP Client in Clojure: 200 Lines of Code, Minimalist Language Server Interaction

2025-05-11

This blog post details how the author implemented a minimal LSP client in under 200 lines of Clojure code and used it to build a command-line code linter. It walks through the implementation of the base communication layer, JSON-RPC layer, and client API for the LSP protocol. The author then discusses the challenges of using LSP in practice, particularly the reliance of most language servers on notifications instead of requests for diagnostics, making a simple command-line tool more complex than expected. Finally, the author summarizes the pros and cons of LSP and speculates on the future of WASM-based language servers.

Read more
Development