feat: add MCP server to expose Finary portfolio to LLMs#266
Draft
nmathey wants to merge 3 commits intolasconic:mainfrom
Draft
feat: add MCP server to expose Finary portfolio to LLMs#266nmathey wants to merge 3 commits intolasconic:mainfrom
nmathey wants to merge 3 commits intolasconic:mainfrom
Conversation
Owner
|
I tested a couple calls and they don't work. For reference, I used the following file with LMstudio and Qwen3.5-9b (so everything running locally) |
Contributor
Author
|
Working mapping:
|
Introduces a new tool to aggregate and return total wealth values by asset category, providing a consolidated view across real estate, SCPI, investments, crypto, and other asset types. Refactors data retrieval to use more granular category-specific APIs for improved accuracy and clarity. Enhances error handling and data extraction for summary calculations.
Contributor
Author
|
I did fix some function calls but I'll need to install LMstudio and Qwen3.5-9b like you in order to test again as I'm getting size response limite form my free claude desktop account... |
Owner
|
It's a hint that the finary API is too verbose as it maybe ? The server could reduce the verbosity to limit the token usage ? |
Contributor
Author
|
Ok I did refactor responses handling to optimize token usage. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #265.
Introduces mcp_server.py, a Model Context Protocol server that wraps the existing finary_uapi functions and exposes them as MCP tools. This allows any MCP-compatible LLM client (Claude Desktop, Cursor…) to query a Finary portfolio in natural language.
18 read-only tools covering investments, cryptos, real estates, crowdlendings, precious metals, SCPIs, fonds euro, startups and generic assets
Session handled via the existing auth.prepare_session() and credentials.json — no extra auth setup required
Requires mcp >= 1.0.0 added to pyproject.toml
Updated README with setup instructions and usage examples