| from llama_index.tools.mcp import BasicMCPClient, McpToolSpec | |
| class JournalMCPClient: | |
| def __init__(self): | |
| self.mcp_client = BasicMCPClient( | |
| "npx", | |
| ["@coji/journal-mcp"], | |
| ) | |
| async def get_tools(self): | |
| mcp_tool_spec = McpToolSpec( | |
| client=self.mcp_client, | |
| allowed_tools=[ | |
| "add_entry", | |
| # "search_entries", | |
| "get_recent_entries", | |
| # "list_tags", | |
| "get_entry_by_date", | |
| "get_daily_summary", | |
| ], | |
| ) | |
| mcp_tools = await mcp_tool_spec.to_tool_list_async() | |
| return mcp_tools | |