Back to MCP work for the pursuit of another position.
OAuth is our friend.
Back in the old days (11 or so years ago), it was simple enough to provide some credentials to your running application, and google was happy with that. Agreed, an increase in security is important, but I will have to remind myself to regenerate the token.json file in my system every week.
The overview
MCP is 'the bomb' these days with the cool kids. So I had looked into this previously but I have decided to warm it up and work on it, my own solution system, and of course continue with the gtest, unified reporting for jenkins, and a personal project.
The steps
The steps for my goal are as follows:
- install llama 3.1 or 3.2 into my ollama system
- dust off the google OAuth code that I had for calendars
- set up mcp stuff for talking with my ollama system
- set up mcp stuff with my calendar code
- set up mcp stuff for my local jenkins system
- figure out server set up to interpret my org-mode files
- set up mcp stuff for my emails
install llama 3.1 or 3.2 into my ollama system
Done - running llama3.1:latest. Apparently the .json stuff for ollama and llama3.1 is a match made in heaven.
This is a perfect solution for an on-premises solution such as my own.
dust off the google OAuth code that I had for calendars
I had some code running from about 6 months ago to do the whole OAuth shenanigans and jumping about.
I needed to upgrade the version of python being used since in another week or so, the older versions won't be supported.
I love "pyenv local <version>". This is such an incredible tool.
- confirm old calendars.py tool works
- repair environment with calendars.py after seeing warnings
pip freeze > requirements.txt
deactivate
rm -rf venv
pyenv local 3.14
python -m venv venv
python -m pip install -r requirements.txt
python calendars.py
(error regarding token)
python get-credentials.py
(credentials retrieved!)
python calendars.py
(expected output!)
set up mcp stuff for talking with my ollama system
ollama-first.py is written so I can communicate with ollama directly. This works!
Sample ollama-mcp.py client code is present.
Now need the mcp server to begin this m-f'ng giggle fest.
This is now working for proving in the communication with ollama and mcp to google calendar.
...
* September 23:
+ Reach out, breathe, collect.
+ Hunting
+ House Chores
+ Lunch
+ Personal Projects
* September 24:
+ Black bin, green bin, and yard trimmings
+ Reach out, breathe, collect.
+ Hunting
+ House Chores
+ Lunch
+ Personal Projects
+ TON of Demos
...
figure out server set up to interpret my org-mode files
Getting there - I had used an Effort tag in my system (think :DRAWER: format) and it's not quite in line with the duration estimates for projects. I will try to update with changing the prompt out to using :Effort: and see if that helps. If not, I will have to use the Scheduled fields for some reason or not...
I'm calling this at least close enough. Server technology is coming along!
Email is doable! Yay!
I needed to add gmail.readonly and the credentials for that. So now... The work flow will be:
read in email_list from a magic file
for each email in email_list:
use calendar credential -> calendar.email.token.json
use email credential -> gmail.email.token.json
set up mcp client and server with all .json files
have the server also read in the .todo files and put a watch on them for updates
then, if all goes well, the llm can be queried for things