-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmix.exs
More file actions
110 lines (97 loc) · 3.13 KB
/
Copy pathmix.exs
File metadata and controls
110 lines (97 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
defmodule Phantom.MixProject do
use Mix.Project
def project do
[
compilers: Mix.compilers(),
app: :phantom_mcp,
description: "Elixir MCP (Model Context Protocol) server library with Plug",
deps: deps(),
docs: docs(),
elixir: "~> 1.18",
elixirc_paths: elixirc_paths(Mix.env()),
escript: escript(Mix.env()),
package: package(),
start_permanent: Mix.env() == :prod,
version: "0.5.2",
source_url: "https://github.com/dbernheisel/phantom_mcp"
]
end
def cli do
[
preferred_envs: [tidewave: :test, format: :test]
]
end
def application do
[
extra_applications: [:logger]
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(:stdio), do: ["lib", "test/support/app"]
defp elixirc_paths(_), do: ["lib"]
defp escript(:stdio), do: [main_module: Test.Stdio, app: nil]
defp escript(_), do: []
defp deps do
[
{:plug, "~> 1.0"},
{:telemetry, "~> 1.0"},
{:phoenix_pubsub, "~> 2.0", optional: true, only: [:dev, :test, :prod, :stdio]},
{:uuidv7, "~> 1.0"},
## Test
{:phoenix_live_view, "~> 1.0", only: [:dev, :test, :stdio]},
{:ex_doc, "~> 0.31", only: :dev, warn_if_outdated: true, runtime: false},
{:tidewave, "~> 0.5", only: [:dev, :test], warn_if_outdated: true},
{:makeup_javascript, "~> 0.1", only: :dev},
{:phoenix_live_reload, "~> 1.5", only: [:dev, :test, :stdio]},
{:bandit, "~> 1.0", only: [:dev, :test]}
]
end
defp package do
[
name: :phantom_mcp,
maintainers: ["David Bernheisel"],
licenses: ["MIT"],
files: ~w[lib priv .formatter.exs mix.exs README.md LICENSE CHANGELOG.md assets/*.png],
links: %{
"MCP Specification" => "https://modelcontextprotocol.io",
"MCP Inspector" => "https://github.com/modelcontextprotocol/inspector",
"GitHub" => "https://github.com/dbernheisel/phantom_mcp"
}
]
end
@mermaidjs """
<script defer src="https://cdn.jsdelivr.net/npm/mermaid@10.2.3/dist/mermaid.min.js"></script>
<script>
let initialized = false;
window.addEventListener("exdoc:loaded", () => {
if (!initialized) { mermaid.initialize({
startOnLoad: false,
theme: document.body.className.includes("dark") ? "dark" : "default"
});
initialized = true;
}
let id = 0;
for (const codeEl of document.querySelectorAll("pre code.mermaid")) {
const preEl = codeEl.parentElement;
const graphDefinition = codeEl.textContent;
const graphEl = document.createElement("div");
const graphId = "mermaid-graph-" + id++;
mermaid.render(graphId, graphDefinition).then(({svg, bindFunctions}) => {
graphEl.innerHTML = svg;
bindFunctions?.(graphEl);
preEl.insertAdjacentElement("afterend", graphEl);
preEl.remove();
});
}
});
</script>
"""
defp docs do
[
main: "Phantom",
extras: ["guides/mcp_apps.md", "CHANGELOG.md"],
assets: %{"assets" => "assets"},
before_closing_body_tag: %{html: @mermaidjs}
]
end
end