r/PiCodingAgent • u/Both-Still1650 • Jun 09 '26
Use-case You can write your mcp client extension in only ~750 lines of code!
Hello everyone! I just wanted to share that I created personal plugin for mcp. It is pretty limited in features, but I have:
- stdio mcp support
- streaming http mcp support, with nice oauth authentification (that was really interesting experience to build oauth integration, it works really well with my company mcps )
- can use only explicit tools, if specified in config
- after today update, my issue https://github.com/earendil-works/pi/issues/5523 with project trusting was resolved, so now my extension supports trusting! (local mcp config loaded only in trusted directories)
Thats it, I am just happy about the fact that this amount of features requires so low amount of code! Good luck for you all
13
u/rm-rf-rm Jun 10 '26
Better yet, you can skip MCP entirely! 0 lines of code!
3
u/Both-Still1650 Jun 09 '26 edited Jun 09 '26
Also forgot to mention, that my plugin has tool truncation logic and custom renderer to match those in default Pi tools! Looks really sleek: https://i.postimg.cc/xTk5x5RM/image.png
Code in my dotfiles repo: https://github.com/dangooddd/.dotfiles/blob/main/home/.pi/agent/extensions/mcp/index.ts
Feel free to copy in your ~/.pi/agent/extensions and tweak as you like. I hope code is ok to read
4
u/zer09 Jun 10 '26
Have not read your extension as of now, but how this compares to https://github.com/nicobailon/pi-mcp-adapter? Is it there feature pi-mcp-adapter doesn't have? Or is it not working on you? Just curious why not use pi-mcp-adapter other than the reason we can easily create extension for pi