\

Help: Using reflection to discovery and invoke methods

2 points - yesterday at 2:30 PM


Hi HN, I was working on different MCP project, every time I have to write MCP server as wrapper of methods\functions.

Then I realize that with memory managed languages I can use reflection to scan methods directly insiede the application and then just fire.

Yes, I still need to write json file with name,arguments and description but this is fine to me, there are already program to do this in automatic way.

Now I was just wondering if some one else has already use this kind of pattern over MCP to avoid wrapper and unlock potential things:

- Avoid update any part of the code, just update json.

- Try to unlock potential thigs that are has not been scheduled on code, with this the agent has potentially access to any part of code.

It's just an experiment to see how much potential it unlocks and whether it makes sense. Has anyone ever tried this technical approach?

Any general feedback, or input from anyone who has already tried it?