<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-ai-mcp-helpers.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-17T19:11:21+00:00</updated>
<entry>
<title>feat(ai-mcp): add pure-helper foundation with tests</title>
<updated>2026-05-17T19:11:21+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-17T19:11:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=54d231be98bdde220355102abb8b37f3740db74d'/>
<id>urn:sha1:54d231be98bdde220355102abb8b37f3740db74d</id>
<content type='text'>
First of nine phases for wiring mcp.el into GPTel. I scoped this
phase to sections 1 (constants and defcustoms) and 3 (pure
helpers) of the seven-section outline in the design doc. The
other five sections ship in later phases. The module loads only
under the test harness for now. init.el wiring waits for Phase 4.

What I added:

- cj/mcp-server-specs defconst: secret-free description of the 9
  servers (linear, notion, figma, slack-deepsat, drawio,
  google-calendar, google-docs-personal, google-docs-work,
  google-keep).
- Seven defcustoms: claude-config path, enabled-servers list,
  start-on-entry-points scope, two timeouts, per-tool confirm
  overrides, audit-log toggle.
- cj/mcp--read-claude-config with an mtime cache and structured
  (:ok t/nil :reason ...) returns.
- cj/mcp--get-server-entry, get-env, and get-secret-arg for
  pulling server data from the parsed config (figma's API key
  lives in args, not env).
- cj/mcp--build-server-alist: pure transformer from specs plus
  config to the alist mcp-hub-servers expects.
- cj/mcp--confirm-p classifier with write-pattern, read-pattern,
  and unknown-fails-closed branches, plus a
  cj/mcp-tool-confirm-overrides alist override.
- cj/mcp--normalize-description prefixing tool descriptions with
  [SERVER], [SERVER WRITE], or [SERVER ?].
- cj/mcp--redact masking --token, --secret, --password, and
  --figma-api-key flags, Authorization headers, and ?token= URL
  params.

Tests in tests/test-ai-mcp-helpers.el (41 ERT tests, all green):
fixtures via make-temp-file, no real ~/.claude.json reads, no
subprocesses, no network. Sentinel REDACTED_TEST_SECRET never
appears in any redactor output.

Design doc: docs/design/mcp-el-gptel-integration.org
</content>
</entry>
</feed>
